Directions API

API ID 5157

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

100% uptime 144 ms avg response

API Documentation

Endpoints

Request

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

Endpoint ID: 6578
GET https://zylalabs.com/api/5157/directions+api/6578/get+directions
INPUT PARAMETERS

Get Directions — Endpoint Features

Object Description
origin Required Indicates an origin
destination Required Indicates an destination.

Free test requests remaining: 3 of 3.


INPUT PARAMETERS

origin
destination
API EXAMPLE RESPONSE
JSON
{
   "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" : "ChIJg3XXhNrX3IARUc0M9bIC_X4",
         "types" : 
         [
            "amusement_park",
            "establishment",
            "lodging",
            "point_of_interest"
         ]
      }
   ],
   "routes" : 
   [
      {
         "bounds" : 
         {
            "northeast" : 
            {
               "lat" : 34.13621000000001,
               "lng" : -117.9223126
            },
            "southwest" : 
            {
               "lat" : 33.8178372,
               "lng" : -118.3526957
            }
         },
         "copyrights" : "Map data ©2024 Google",
         "legs" : 
         [
            {
               "distance" : 
               {
                  "text" : "34.9 mi",
                  "value" : 56214
               },
               "duration" : 
               {
                  "text" : "48 mins",
                  "value" : 2904
               },
               "end_address" : "Anaheim, CA 92802, USA",
               "end_location" : 
               {
                  "lat" : 33.8178372,
                  "lng" : -117.9223126
               },
               "start_address" : "100 Universal City Plaza, Universal City, CA 91608, USA",
               "start_location" : 
               {
                  "lat" : 34.1345191,
                  "lng" : -118.3514579
               },
               "steps" : 
               [
                  {
                     "distance" : 
                     {
                        "text" : "486 ft",
                        "value" : 148
                     },
                     "duration" : 
                     {
                        "text" : "1 min",
                        "value" : 19
                     },
                     "end_location" : 
                     {
                        "lat" : 34.1358101,
                        "lng" : -118.3511704
                     },
                     "html_instructions" : "Head \u003cb\u003enortheast\u003c/b\u003e on \u003cb\u003eUniversal Studios Blvd\u003c/b\u003e",
                     "polyline" : 
                     {
                        "points" : "w{ioErojqUGEECGCGCGCGCGCKCICEACACAIAEAGAIAGAGAG?IAQCM@I@i@@OA"
                     },
                     "start_location" : 
                     {
                        "lat" : 34.1345191,
                        "lng" : -118.3514579
                     },
                     "travel_mode" : "DRIVING"
                  },
                  {
                     "distance" : 
                     {
                        "text" : "0.3 mi",
                        "value" : 450
                     },
                     "duration" : 
                     {
                        "text" : "2 mins",
                        "value" : 135
                     },
                     "end_location" : 
                     {
                        "lat" : 34.1329768,
                        "lng" : -118.3526957
                     },
                     "html_instructions" : "Make a \u003cb\u003eU-turn\u003c/b\u003e",
                     "maneuver" : "uturn-left",
                     "polyline" : 
                     {
                        "points" : "ycjoExmjqUYCA?E?E?A?E@CBC@CBC@A@CBCBCB?@AB?@?@?@?@?@?@@@?@@@@@@@@?BB@?@?@?@?@?@AB?@??AB?@?ZGJCZ?TCPC@?T?B?F?H?PB@?PBLBLJFFHDJBNFFDNFHFJFTPj@^PL`@Xh@\\NJPJTJTJPHNDLDHB"
                     },
                     "start_location" : 
                     {
                        "lat" : 34.1358101,
                        "lng" : -118.3511704
                     },
                     "travel_mode" : "DRIVING"
                  },
                  {
                     "distance" : 
                     {
                        "text" : "9.6 mi",
                        "value" : 15489
                     },
                     "duration" : 
                     {
                        "text" : "17 mins",
                        "value" : 996
                     },
                     "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" : "crioEjwjqU\\[Hc@Fa@@KJe@DOFU@CHUDK?A@AJWFOJQBIVe@\\m@BANUHMNS@A?ACi@NOVWRUTURSHKDETUJMFGRSRURSPSFGLMRSPSPQNOBEBCPQBCPQRSNQDC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@@C@SBY"
                     },
                     "start_location" : 
                     {
                        "lat" : 34.1329768,
                        "lng" : -118.3526957
                     },
                     "travel_mode" : "DRIVING"
                  },
                  {
                     "distance" : 
                     {
                        "text" : "2.3 mi",
                        "value" : 3669
                     },
                     "duration" : 
                     {
                        "text" : "2 mins",
                        "value" : 143
                     },
                     "end_location" : 
                     {
                        "lat" : 34.026525,
                        "lng" : -118.2089504
                     },
                     "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@_ABEFMBGFIHKFMPURUHITWHIJIFGJIHGNKHGPKpAk@jAe@PGXMbAa@DAjAe@vAk@j@SXKJEf@MPGt@UPELCb@K^GPCZEVE`@Gr@GFANAl@ERAPAZAj@A`AAB?NAF?j@ApAAP?VAjAAj@AjAAnADN?j@Dv@Fj@DTBpANhANJ@t@J`@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@Ex@I\\Gv@Or@QBAZK@?HEDANGBAhB{@b@WXULKdByABAVUJMh@g@VYTWRSNSPSLOPS?ATYPWNSJO\\g@NUJQRYJSLUP[LSJSJUJQFOTc@Xo@JUFQp@wANe@Ri@pA}DdA{CNe@Z{@HWFOX{@`@mAn@kBn@mBPg@Vw@d@wADKb@oAL_@HYXw@DKHYXy@L]HW@??AVM"
                     },
                     "start_location" : 
                     {
                        "lat" : 34.0525166,
                        "lng" : -118.2258658
                     },
                     "travel_mode" : "DRIVING"
                  },
                  {
                     "distance" : 
                     {
                        "text" : "22.0 mi",
                        "value" : 35436
                     },
                     "duration" : 
                     {
                        "text" : "25 mins",
                        "value" : 1487
                     },
                     "end_location" : 
                     {
                        "lat" : 33.8261327,
                        "lng" : -117.9260045
                     },
                     "html_instructions" : "Merge onto \u003cb\u003eI-5 S\u003c/b\u003e",
                     "maneuver" : "merge"}]}]}],"_note":"Response truncated for documentation purposes"}
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 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.

No long-term commitment. Upgrade, downgrade, or cancel anytime. Free Trial includes up to 50 requests.

(Save 2 months with annual billing 🎉)

🚀 Enterprise Plan

Starts at
$ 10,000/Year


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

Overview

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.

Directions API FAQs

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.

The Get Directions endpoint returns detailed route information, including geocoded waypoints, estimated travel distance, duration, and step-by-step navigation instructions.

Key fields in the response include "geocoded_waypoints" for location details, "routes" for route information, "bounds" for geographical limits, and "copyrights" for data usage rights.

The response data is structured in JSON format, with nested objects for waypoints and routes. Each route contains bounds, steps, and travel details, making it easy to parse and utilize.

Users can specify parameters such as "origin" and "destination" coordinates, and optionally include "mode" of transportation (e.g., driving, walking) to customize their requests.

The endpoint provides information on routes, including distance, duration, step-by-step directions, and traffic conditions, which are crucial for effective trip planning.

Data accuracy is maintained through real-time traffic updates and reliable mapping sources, ensuring that users receive the most current and efficient routing information.

Typical use cases include navigation applications, trip planning tools, delivery services, and any application requiring route optimization and travel time estimation.

Users can extract specific route details from the response, such as travel time and distance, to display in their applications, or use step-by-step directions for navigation purposes.

General FAQs

To obtain your API key, first sign in to your account and navigate to the API you want to use. From the API's Pricing section, choose a plan and complete the subscription process. Once subscribed, return to the API page and you will see your API Access Key displayed at the top of the documentation page. You can use this key to authenticate your requests.

You can’t switch APIs during the free trial. If you subscribe to a different API, your trial will end and the new subscription will start as a paid plan.

The free trial lasts for 7 days and allows you to make up to 50 API requests.

No, the free trial is available only once, so we recommend using it on the API that interests you the most. Most of our APIs offer a free trial, but some may not include this option.

Yes. If the API offers a free trial, you will see a "Free 7-Day Trial" option in its Pricing section. The trial lasts for 7 days and allows up to 50 API requests, enabling you to evaluate the API before subscribing to a paid plan.

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, refer to the 'X-Zyla-API-Calls-Monthly-Remaining' field in the response header. For example, if your plan allows 1,000 requests per month and you've used 100, this field in the response header will indicate 900 remaining calls.

You can monitor your API usage through the response headers included with every request:

x-zyla-api-calls-monthly-used: Shows the total number of API requests you have used during the current billing period.
x-zyla-api-calls-monthly-remaining: Shows the number of API requests you have remaining for the current billing period.

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 3,600, it means 3,600 seconds are left until the limit resets.

Yes, you can cancel your subscription at any time. Simply go to the Pricing section of the API you're subscribed to and click the "Unsubscribe" button.

Please note that upgrades, downgrades, and cancellations take effect immediately. Once your subscription is canceled, access to the service will end immediately, regardless of any remaining API calls in your quota.

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 free trial, you can make up to 50 API calls. If you wish to make additional API calls beyond this limit, the API will prompt you to perform an "Start Your Paid Plan." You can find the "Start Your Paid Plan" button in your profile under Subscription -> Choose the API you are subscribed to -> Pricing tab.
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]

Please have a look at our Refund Policy: https://zylalabs.com/terms#refund


Related APIs