Directions API

Get detailed routes between two locations, including distance, duration and steps, for easy navigation and efficient trip planning.

About the API: 

Directions API allows users to access detailed route information between locations. By leveraging this API, users can obtain accurate directions for various modes of transportation. This capability not only enhances the user experience, but also facilitates the development of applications that require navigation functions.

The API works by taking a set of origin and destination coordinates and processing the request to return complete address data. This includes estimated distance and travel time, which are essential for users to plan their journeys. The accuracy of this information is greatly enhanced by the API's ability to take real-time traffic conditions into account, ensuring that users receive the most efficient routes available. This feature is especially important in urban environments, where traffic can be unpredictable and significantly affect journey times.

Overall, the Directions API is a vital resource for users wishing to implement navigation features in their applications. Its ability to provide accurate, detailed and efficient routing information enhances the user experience and helps users create more engaging and useful applications.

API Documentation

Endpoints


To use this endpoint you must specify an origin and destination in the parameters.



                                                                            
GET https://zylalabs.com/api/5157/directions+api/6578/get+directions
                                                                            
                                                                        

Get Directions - Endpoint Features

Object Description
origin [Required] Indicates an origin
destination [Required] Indicates an destination.
Test Endpoint

API EXAMPLE RESPONSE

       
                                                                                                        
                                                                                                                                                                                                                            {
   "geocoded_waypoints" : 
   [
      {
         "geocoder_status" : "OK",
         "partial_match" : true,
         "place_id" : "ChIJzzgyJU--woARcZqceSdQ3dM",
         "types" : 
         [
            "amusement_park",
            "establishment",
            "point_of_interest",
            "tourist_attraction"
         ]
      },
      {
         "geocoder_status" : "OK",
         "partial_match" : true,
         "place_id" : "ChIJa147K9HX3IAR-lwiGIQv9i4",
         "types" : 
         [
            "amusement_park",
            "establishment",
            "point_of_interest",
            "tourist_attraction"
         ]
      }
   ],
   "routes" : 
   [
      {
         "bounds" : 
         {
            "northeast" : 
            {
               "lat" : 34.13621000000001,
               "lng" : -117.9221333
            },
            "southwest" : 
            {
               "lat" : 33.815744,
               "lng" : -118.3526932
            }
         },
         "copyrights" : "Map data Β©2024 Google",
         "legs" : 
         [
            {
               "distance" : 
               {
                  "text" : "35.1 mi",
                  "value" : 56466
               },
               "duration" : 
               {
                  "text" : "48 mins",
                  "value" : 2865
               },
               "end_address" : "Anaheim, CA 92802, USA",
               "end_location" : 
               {
                  "lat" : 33.815744,
                  "lng" : -117.9225876
               },
               "start_address" : "100 Universal City Plaza, Universal City, CA 91608, USA",
               "start_location" : 
               {
                  "lat" : 34.134496,
                  "lng" : -118.3514803
               },
               "steps" : 
               [
                  {
                     "distance" : 
                     {
                        "text" : "0.4 mi",
                        "value" : 602
                     },
                     "duration" : 
                     {
                        "text" : "3 mins",
                        "value" : 154
                     },
                     "end_location" : 
                     {
                        "lat" : 34.132976,
                        "lng" : -118.3526932
                     },
                     "html_instructions" : "Head \u003cb\u003enortheast\u003c/b\u003e on \u003cb\u003eUniversal Studios Blvd\u003c/b\u003e",
                     "polyline" : 
                     {
                        "points" : "s{ioEvojqUKGGCGCECGCGCICICICGAAACAKACAGAIAGAGAG?IAQAMAI?i@?O@YCA?E?E?A?E@CBC@CBC@A@CBCBCB?@AB?@?@?@?@?@?@@@?@@@@@@@@?BB@?@?@?@?@?@AB?@??AB?@?ZGJCZ?TCPC@?T?B?F?H?PB@?PBLBLJFFHDJBNFFDNFHFJFTPj@^PL`@Xh@\\NJPJTJTJPHNDNDF@"
                     },
                     "start_location" : 
                     {
                        "lat" : 34.134496,
                        "lng" : -118.3514803
                     },
                     "travel_mode" : "DRIVING"
                  },
                  {
                     "distance" : 
                     {
                        "text" : "9.6 mi",
                        "value" : 15488
                     },
                     "duration" : 
                     {
                        "text" : "17 mins",
                        "value" : 990
                     },
                     "end_location" : 
                     {
                        "lat" : 34.0525166,
                        "lng" : -118.2258658
                     },
                     "html_instructions" : "Turn \u003cb\u003eleft\u003c/b\u003e to merge onto \u003cb\u003eUS-101 S\u003c/b\u003e",
                     "maneuver" : "ramp-left",
                     "polyline" : 
                     {
                        "points" : "crioEhwjqU\\UHg@Fa@BKJe@BOFU@CHUDK?A?AJWHQHQDGTe@^m@@CNU@A\\e@?AAe@NORURUTURSHKDETUJMFGRSRURSPSFGLMRSPSPQNOBEBCPQBCPQRSNQDCJMDEPQFGNOPSJIHKRSRS@AP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                     {
                        "lat" : 34.132976,
                        "lng" : -118.3526932
                     },
                     "travel_mode" : "DRIVING"
                  },
                  {
                     "distance" : 
                     {
                        "text" : "2.3 mi",
                        "value" : 3667
                     },
                     "duration" : 
                     {
                        "text" : "2 mins",
                        "value" : 143
                     },
                     "end_location" : 
                     {
                        "lat" : 34.02653310000001,
                        "lng" : -118.2089557
                     },
                     "html_instructions" : "Keep \u003cb\u003eright\u003c/b\u003e to stay on \u003cb\u003eUS-101 S\u003c/b\u003e",
                     "maneuver" : "keep-right",
                     "polyline" : 
                     {
                        "points" : "g{ynEt~qpUFS@GBOHa@@IDSDYFQDOTw@@EL]b@_ABEFMBGFIHKFMPURUHITWHIJIFGJIHGNKHGPKpAi@jAg@PGXMbAa@DAbAa@~Ao@j@SXKLCd@OPGv@SNGLCb@K^GPCZEVE`@Gr@GFANAl@ERAPAZAj@A`AAB?NAF?j@AdAARA`@?jAAj@AjA?nABN?j@Dv@Fj@DTDpALpAPL@j@H`@F\\DNBd@Dv@FT@R@Z?L?d@?NA^AJ?l@Et@Gh@CL?`@?B?L?`@@n@B^@\\DN@ZB|@Jd@DF?L@X@P?^@B?|@Cd@Ep@Gd@Iv@Or@QBAZK@?HEDANGBAdBw@f@[XULKdByABAVUJMh@g@VYTWRSNSPSLOPS?ATYPWNSJO\\g@NUJQRYJSLUP[LSJSJUJQFOTc@Xo@JUFQl@{APa@Rk@rA{DdA{CPe@X{@HWFOX{@`@mAn@kBl@mBPi@Xu@d@wADKb@oAL_@HYVw@DKHYZy@L]JW?A@?RK"
                     },
                     "start_location" : 
                     {
                        "lat" : 34.0525166,
                        "lng" : -118.2258658
                     },
                     "travel_mode" : "DRIVING"
                  },
                  {
                     "distance" : 
                     {
                        "text" : "22.0 mi",
                        "value" : 35437
                     },
                     "duration" : 
                     {
                        "text" : "25 mins",
                        "value" : 1483
                     },
                     "end_location" : 
                     {
                        "lat" : 33.8261327,
                        "lng" : -117.9260045
                     },
                     "html_instructions" : "Merge onto \u003cb\u003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Z[PSRQVWPQVURSRQVWt@s@XURUf@e@@?PQTUTSRQPQTSZY`@a@TSf@g@VUTSDG^[LOh@e@PQ`@_@XYXWPOHIPQVSROPMBCHELKTODCFEVODCDC\\Sb@Uz@c@TKLGTMj@Y\\SPKXOLIJGVQRM\\YZWXUb@a@PQVUz@y@FEd@e@f@e@xAwA^]x@w@HIz@w@dAeAnAkAjAiA\\]pBkBpAoAv@s@XYj@k@`@_@`A_ADGLMz@y@\\]HIz@y@TSRQLOLIXWTUrAoAl@k@f@g@^]^]j@k@d@c@HIFIJIFGNSRUPUNSPUDGLS^k@NYXc@Xg@NW^m@LU`@q@FIVc@?AR[NULUPWNUV_@^e@@ANSRULMVWRSRSRSRS|@}@d@g@f@g@^]PQHIf@g@b@c@TUJMj@i@XY^a@FGRQx@{@b@a@FId@e@j@k@NORSf@g@x@y@z@}@LKRSX[PQ...
                                                                                                                                                                                                                    
                                                                                                    

Get Directions - CODE SNIPPETS


curl --location --request GET 'https://zylalabs.com/api/5157/directions+api/6578/get+directions?origin=Universal Studios Hollywood&destination=Disneyland' --header 'Authorization: Bearer YOUR_API_KEY' 


    

API Access Key & Authentication

After signing up, every developer is assigned a personal API access key, a unique combination of letters and digits provided to access to our API endpoint. To authenticate with the Directions API REST API, simply include your bearer token in the Authorization header.
Headers
Header Description
Authorization [Required] Should be Bearer access_key. See "Your API Access Key" above when you are subscribed.

Simple Transparent Pricing

No long term commitments. One click upgrade/downgrade or cancellation. No questions asked.

πŸš€ Enterprise

Starts at
$ 10,000/Year


  • Custom Volume
  • Specialized Customer Support
  • Real-Time API Monitoring

Customer favorite features

  • βœ”οΈŽ Only Pay for Successful Requests
  • βœ”οΈŽ Free 7-Day Trial
  • βœ”οΈŽ Multi-Language Support
  • βœ”οΈŽ One API Key, All APIs.
  • βœ”οΈŽ Intuitive Dashboard
  • βœ”οΈŽ Comprehensive Error Handling
  • βœ”οΈŽ Developer-Friendly Docs
  • βœ”οΈŽ Postman Integration
  • βœ”οΈŽ Secure HTTPS Connections
  • βœ”οΈŽ Reliable Uptime

To use this API, users must indicate a source and a destination.

There are different plans suits everyone including a free trial for

Directions API allows you to calculate routes, obtain detailed directions, estimate travel times and optimize paths between multiple points.

The Directions API receives an origin and a destination, and returns information about the route, travel times, distances and detailed navigation steps.

Besides the number of API calls per month, there are no other limitations.

Zyla API Hub is like a big store for APIs, where you can find thousands of them all in one place. We also offer dedicated support and real-time monitoring of all APIs. Once you sign up, you can pick and choose which APIs you want to use. Just remember, each API needs its own subscription. But if you subscribe to multiple ones, you'll use the same key for all of them, making things easier for you.

Prices are listed in USD (United States Dollar), EUR (Euro), CAD (Canadian Dollar), AUD (Australian Dollar), and GBP (British Pound). We accept all major debit and credit cards. Our payment system uses the latest security technology and is powered by Stripe, one of the world’s most reliable payment companies. If you have any trouble paying by card, just contact us at [email protected]

Additionally, if you already have an active subscription in any of these currencies (USD, EUR, CAD, AUD, GBP), that currency will remain for subsequent subscriptions. You can change the currency at any time as long as you don't have any active subscriptions.

The local currency shown on the pricing page is based on the country of your IP address and is provided for reference only. The actual prices are in USD (United States Dollar). When you make a payment, the charge will appear on your card statement in USD, even if you see the equivalent amount in your local currency on our website. This means you cannot pay directly with your local currency.

Occasionally, a bank may decline the charge due to its fraud protection settings. We suggest reaching out to your bank initially to check if they are blocking our charges. Also, you can access the Billing Portal and change the card associated to make the payment. If these does not work and you need further assistance, please contact our team at [email protected]

Prices are determined by a recurring monthly or yearly subscription, depending on the chosen plan.

API calls are deducted from your plan based on successful requests. Each plan comes with a specific number of calls that you can make per month. Only successful calls, indicated by a Status 200 response, will be counted against your total. This ensures that failed or incomplete requests do not impact your monthly quota.

Zyla API Hub works on a recurring monthly subscription system. Your billing cycle will start the day you purchase one of the paid plans, and it will renew the same day of the next month. So be aware to cancel your subscription beforehand if you want to avoid future charges.

To upgrade your current subscription plan, simply go to the pricing page of the API and select the plan you want to upgrade to. The upgrade will be instant, allowing you to immediately enjoy the features of the new plan. Please note that any remaining calls from your previous plan will not be carried over to the new plan, so be aware of this when upgrading. You will be charged the full amount of the new plan.

To check how many API calls you have left for the current month, look at the β€˜X-Zyla-API-Calls-Monthly-Remaining’ header. For example, if your plan allows 1000 requests per month and you've used 100, this header will show 900.

To see the maximum number of API requests your plan allows, check the β€˜X-Zyla-RateLimit-Limit’ header. For instance, if your plan includes 1000 requests per month, this header will display 1000.

The β€˜X-Zyla-RateLimit-Reset’ header shows the number of seconds until your rate limit resets. This tells you when your request count will start fresh. For example, if it displays 3600, it means 3600 seconds are left until the limit resets.

Yes, you can cancel your plan anytime by going to your account and selecting the cancellation option on the Billing page. Please note that upgrades, downgrades, and cancellations take effect immediately. Additionally, upon cancellation, you will no longer have access to the service, even if you have remaining calls left in your quota.

You can contact us through our chat channel to receive immediate assistance. We are always online from 8 am to 5 pm (EST). If you reach us after that time, we will get back to you as soon as possible. Additionally, you can contact us via email at [email protected]

To let you experience our APIs without any commitment, we offer a 7-day free trial that allows you to make API calls at no cost during this period. Please note that you can only use this trial once, so make sure to use it with the API that interests you the most. Most of our APIs provide a free trial, but some may not support it.

After 7 days, you will be charged the full amount for the plan you were subscribed to during the trial. Therefore, it’s important to cancel before the trial period ends. Refund requests for forgetting to cancel on time are not accepted.

When you subscribe to an API trial, you can make only 25% of the calls allowed by that plan. For example, if the API plan offers 1000 calls, you can make only 250 during the trial. To access the full number of calls offered by the plan, you will need to subscribe to the full plan.

 Service Level
100%
 Response Time
145ms

Category:


Related APIs