Trip Directions API

API ID 1922

The Trip Directions API offers efficient routing and detailed turn-by-turn directions for driving, cycling, walking, or using public transportation. It supports multimodal transportation and can help users plan their trips accurately, considering real-time traffic conditions, distance, and other factors. This API can be integrated into various applications to enhance user experience while navigating.

100% uptime 712 ms avg response

API Documentation

Endpoints

Request

Calculate route between provided waypoints, including turn by turn directions

 
Endpoint ID: 1631
GET https://zylalabs.com/api/1922/trip+directions+api/1631/get+directions
INPUT PARAMETERS

Get Directions — Endpoint Features

Object Description
waypoints Required List of two or more lat,lon coordinates, separated by the pipe symbol \"|\"
mode Required Routing mode - drive, truck, bicycle, walk or transit

Free test requests remaining: 3 of 3.


INPUT PARAMETERS

waypoints
mode
API EXAMPLE RESPONSE
JSON
{
  "features": [
    {
      "type": "Feature",
      "properties": {
        "mode": "drive",
        "waypoints": [
          {
            "location": [
              10.87474,
              48.34364
            ],
            "original_index": 0
          },
          {
            "location": [
              10.90925,
              48.37073
            ],
            "original_index": 1
          }
        ],
        "units": "metric",
        "distance": 7774,
        "distance_units": "meters",
        "time": 627.658,
        "legs": [
          {
            "distance": 7774,
            "time": 627.658,
            "steps": [
              {
                "from_index": 0,
                "to_index": 91,
                "distance": 1581,
                "time": 114.761,
                "instruction": {
                  "text": "Drive north on Gögginger Straße."
                }
              },
              {
                "from_index": 91,
                "to_index": 171,
                "distance": 1312,
                "time": 140.345,
                "instruction": {
                  "text": "Turn right onto Schertlinstraße."
                }
              },
              {
                "from_index": 171,
                "to_index": 187,
                "distance": 189,
                "time": 14.709,
                "instruction": {
                  "text": "Turn right onto Haunstetter Straße."
                }
              },
              {
                "from_index": 187,
                "to_index": 327,
                "distance": 2960,
                "time": 220.233,
                "instruction": {
                  "text": "Turn left onto Inverness-Allee/B 300."
                }
              },
              {
                "from_index": 327,
                "to_index": 352,
                "distance": 1034,
                "time": 78.82,
                "instruction": {
                  "text": "Turn left onto Berliner Allee/B 2."
                }
              },
              {
                "from_index": 352,
                "to_index": 371,
                "distance": 246,
                "time": 23.478,
                "instruction": {
                  "text": "Turn left to take the ramp."
                }
              },
              {
                "from_index": 371,
                "to_index": 388,
                "distance": 435,
                "time": 31.514,
                "instruction": {
                  "text": "Bear right onto Lechhauser Straße."
                }
              },
              {
                "from_index": 388,
                "to_index": 391,
                "distance": 13,
                "time": 3.795,
                "instruction": {
                  "text": "Turn right onto Oblatterwallstraße."
                }
              },
              {
                "from_index": 391,
                "to_index": 391,
                "distance": 0,
                "time": 0,
                "instruction": {
                  "text": "Your destination is on the left."
                }
              }
            ]
          }
        ]
      },
      "geometry": {
        "type": "MultiLineString",
        "coordinates": [
          [
            [
              10.874805,
              48.343631
            ],
            [
              10.874852,
              48.343782
            ],
            [
              10.874924,
              48.344021
            ],
            [
              10.874952,
              48.34411
            ],
            [
              10.87499,
              48.344258
            ],
            [
              10.875009,
              48.344339
            ],
            [
              10.875011,
              48.344449
            ],
            [
              10.875012,
              48.344492
            ],
            [
              10.875087,
              48.344734
            ],
            [
              10.875108,
              48.344801
            ],
            [
              10.875168,
              48.344975
            ],
            [
              10.875213,
              48.345085
            ],
            [
              10.875268,
              48.345217
            ],
            [
              10.875287,
              48.345257
            ],
            [
              10.875318,
              48.345318
            ],
            [
              10.875337,
              48.345356
            ],
            [
              10.87538,
              48.345428
            ],
            [
              10.875401,
              48.345462
            ],
            [
              10.875493,
              48.345611
            ],
            [
              10.875527,
              48.345665
            ],
            [
              10.875643,
              48.345853
            ],
            [
              10.875669,
              48.345889
            ],
            [
              10.875678,
              48.345903
            ],
            [
              10.875736,
              48.345949
            ],
            [
              10.875891,
              48.346057
            ],
            [
              10.876002,
              48.346198
            ],
            [
              10.876047,
              48.346254
            ],
            [
              10.876196,
              48.346467
            ],
            [
              10.876206,
              48.346481
            ],
            [
              10.876255,
              48.346558
            ],
            [
              10.876314,
              48.34666
            ],
            [
              10.876352,
              48.346725
            ],
            [
              10.876409,
              48.346823
            ],
            [
              10.876531,
              48.347054
            ],
            [
              10.876735,
              48.347464
            ],
            [
              10.877069,
              48.348229
            ],
            [
              10.877082,
              48.348258
            ],
            [
              10.877058,
              48.348339
            ],
            [
              10.87705,
              48.348366
            ],
            [
              10.87711,
              48.348499
            ],
            [
              10.877172,
              48.348635
            ],
            [
              10.877244,
              48.348796
            ],
            [
              10.877251,
              48.348809
            ],
            [
              10.877357,
              48.349011
            ],
            [
              10.877454,
              48.34916
            ],
            [
              10.877571,
              48.349303
            ],
            [
              10.877771,
              48.349529
            ],
            [
              10.87779,
              48.34955
            ],
            [
              10.877845,
              48.349586
            ],
            [
              10.877906,
              48.349627
            ],
            [
              10.877935,
              48.349646
            ],
            [
              10.878042,
              48.349732
            ],
            [
              10.878156,
              48.349847
            ],
            [
              10.878293,
              48.350011
            ],
            [
              10.878498,
              48.350257
            ],
            [
              10.878568,
              48.350342
            ],
            [
              10.878661,
              48.350479
            ],
            [
              10.87875,
              48.350609
            ],
            [
              10.878738,
              48.35067
            ],
            [
              10.878732,
              48.350702
            ],
            [
              10.878934,
              48.350931
            ],
            [
              10.879319,
              48.351371
            ],
            [
              10.879521,
              48.351599
            ],
            [
              10.879955,
              48.352082
            ],
            [
              10.879992,
              48.352123
            ],
            [
              10.88022,
              48.352375
            ]]]}}],"_note":"Response truncated for documentation purposes"}
Get Directions — CODE SNIPPETS

curl --location --request GET 'https://zylalabs.com/api/1922/trip+directions+api/1631/get+directions?waypoints=Required&mode=Required' --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 Trip 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.

Simple Transparent Pricing

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

(Save 2 months with annual billing 🎉)

🚀 Enterprise Plan
Custom Volume

  • Custom Rate Limit
  • Team & Access Management
  • SLA-backed Uptime
  • Specialized Customer Support
  • Real-Time API Monitoring
  • Enterprise Security & Compliance
Minimum annual contract: USD 10,000

Trusted by leading companies

Overview

About the API:

The Trip Directions API is a powerful tool that provides routing and turn-by-turn directions for a variety of modes of transportation, including driving, cycling, walking, and public transportation. This API can help users plan their trips efficiently and accurately, taking into account real-time traffic conditions, distance, and other factors.

With the Trip Directions API, developers can easily integrate a routing and directions feature into their applications, making it easy for users to get directions and navigate to their destinations. The API is designed to support various types of transportation modes, including driving, cycling, and walking, and also supports multimodal public transportation, enabling users to find the most optimal route based on their mode of travel.

One of the key features of the Trip Directions API is its ability to provide turn-by-turn directions. This feature allows users to follow a detailed set of directions, including street names, landmarks, and other important information. This makes it easy for users to navigate to their destination, even in unfamiliar areas.

The Trip Directions API also offers a range of additional features that can enhance the user experience, such as real-time traffic updates, estimated travel times, and alternate routes. These features can help users avoid traffic congestion and find the fastest and most efficient route to their destination.

Another important aspect of the Trip Directions API is its flexibility. The API can be customized to meet the specific needs of developers and users, allowing for the integration of additional features and customization of the user interface.

Overall, the Trip Directions API is an essential tool for any developer looking to provide a comprehensive routing and directions feature in their application. With its ability to support various modes of transportation, provide turn-by-turn directions, and offer a range of additional features, the Trip Directions API is a reliable and efficient solution for navigating the world around us.

 

What this API receives and what your API provides (input/output)?

Pass the coordinates for the waypoints and receive the directions for your trip. 

 

What are the most common uses cases of this API?

  1. Transportation and Logistics Management: Companies in the transportation and logistics industry can integrate the Trip Directions API into their systems to optimize their routes and schedules, reducing transportation costs, and improving delivery times. With real-time traffic updates, estimated travel times, and alternate routes, companies can make data-driven decisions to ensure timely and efficient deliveries.

  2. Travel and Tourism: Travel and tourism applications can use the Trip Directions API to help travelers plan their trips, including finding the best routes for various modes of transportation, such as driving, cycling, or walking. With turn-by-turn directions and landmarks, travelers can navigate to their destinations with ease and discover new places along the way.

  3. Fitness and Wellness: Fitness and wellness applications can integrate the Trip Directions API to help users plan their workouts, including finding the best running, cycling, or hiking routes. The API can provide distance and elevation information, helping users to track their progress and achieve their fitness goals.

  4. Emergency Services: Emergency services, such as police, fire, and ambulance services, can use the Trip Directions API to navigate to emergency situations quickly and efficiently. The API can provide real-time traffic updates, estimated travel times, and alternate routes, enabling emergency services to respond to incidents as quickly as possible.

  5. Smart Cities: Cities can use the Trip Directions API to improve their transportation infrastructure and reduce traffic congestion. The API can provide real-time traffic updates, estimated travel times, and alternate routes, helping to optimize traffic flow and reduce carbon emissions. Additionally, cities can integrate the API into their public transportation systems, making it easier for commuters to navigate the city and reducing the number of cars on the road.

 

Are there any limitations to your plans?

Besides API call limitations per month, there are no other limitations. 

Trip Directions API FAQs

The Get Directions endpoint returns detailed routing information, including turn-by-turn directions, estimated travel times, distance, and real-time traffic conditions for the specified waypoints.

Key fields in the response data include "route", which contains the path taken, "legs" for individual segments of the journey, "duration" for travel time, and "steps" for detailed turn-by-turn instructions.

The response data is structured in a JSON format, organized into hierarchical sections such as "routes", "legs", and "steps", allowing users to easily navigate through the information.

Users can customize requests with parameters such as "waypoints" (coordinates), "mode" (driving, cycling, walking, public transport), and "avoid" (tolls, highways) to tailor the routing experience.

The endpoint provides information on routes, estimated travel times, distances, turn-by-turn directions, traffic conditions, and alternative routes based on user-selected transportation modes.

Data accuracy is maintained through continuous updates from reliable sources, including traffic data providers and mapping services, ensuring users receive the most current routing information.

Typical use cases include route optimization for logistics, trip planning for travelers, fitness route mapping, and emergency response navigation, leveraging real-time traffic and distance data.

Users can utilize the returned data by parsing the JSON response to extract relevant fields, such as "steps" for navigation instructions, and integrating this information into their applications for enhanced user experiences.

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


You might also like