The Distance and Duration API is a robust tool designed to calculate and deliver travel distances and durations between various starting and ending locations. It is an invaluable asset for users seeking to incorporate geographic data into their applications, improving decision-making in areas like logistics, travel planning, and transportation management.
With the Distance and Duration API, users can input parameters such as origin and destination addresses. The API processes these inputs and generates a structured response containing key route details between the specified locations. The output typically includes a list of origin and destination addresses, clearly presenting the route information.
In conclusion, whether for personal use or as part of an application, the Distance and Duration API streamlines route planning and travel time estimation. Its comprehensive and structured outputs make it a vital resource for integrating geographic data into systems, enhancing both functionality and user experience in today’s interconnected world.
{
"destination_addresses" :
[
"New York, NY, USA"
],
"origin_addresses" :
[
"Washington, DC, USA"
],
"rows" :
[
{
"elements" :
[
{
"distance" :
{
"text" : "362 km",
"value" : 361721
},
"duration" :
{
"text" : "3 hours 53 mins",
"value" : 13992
},
"status" : "OK"
}
]
}
],
"status" : "OK"
}
curl --location --request GET 'https://zylalabs.com/api/5452/distance+and+duration+api/7076/get+distance?destinations=New York City, NY&origins=Washington, DC' --header 'Authorization: Bearer YOUR_API_KEY'
| 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.
To use this API users must indicate 2 locations to measure the distance.
The Distance and Duration API calculates and monitors the distance between two or more locations, providing real-time updates on travel time, distance covered, and estimated arrival, enhancing logistics and travel management.
There are different plans suits everyone including a free trial for small amount of requests, but it’s rate is limit to prevent abuse of the service.
Receives origin and destination inputs and provides calculated distance, travel time, and status between specified locations efficiently.
Besides the number of API calls per month, there are no other limitations.
The API returns travel distance, duration, and status between specified origin and destination locations. It includes detailed route information, such as the distance in both text and value formats, and the estimated travel time.
Key fields in the response include "origin_addresses," "destination_addresses," "distance," "duration," and "status." Each field provides specific information about the route and travel metrics.
The response is structured in a JSON format, containing arrays for origin and destination addresses, and a "rows" array that holds elements detailing distance and duration for each route.
The primary parameters are the origin and destination locations, which can be specified as addresses or geographic coordinates. Users can customize requests by providing different locations.
The API provides information on travel distance, estimated travel duration, and the status of the request. It helps users understand the logistics of travel between two points.
Data accuracy is maintained through the use of reliable geographic databases and continuous updates from mapping services. Quality checks ensure that the information provided is current and precise.
Typical use cases include logistics planning, travel itinerary creation, and transportation management. Businesses can optimize routes and estimate delivery times using the API's data.
Users can extract distance and duration values to inform travel plans, logistics operations, or application features. The structured format allows easy integration into various systems for real-time decision-making.
To obtain your API key, you first need to sign in to your account and subscribe to the API you want to use. Once subscribed, go to your Profile, open the Subscription section, and select the specific API. Your API key will be available there and can be used 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.
If you don’t cancel before the 7th day, your free trial will end automatically and your subscription will switch to a paid plan under the same plan you originally subscribed to, meaning you will be charged and gain access to the API calls included in that plan.
The free trial ends when you reach 50 API requests or after 7 days, whichever comes first.
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, we offer a 7-day free trial that allows you to make up to 50 API calls at no cost, so you can test our APIs without any commitment.
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.
Please have a look at our Refund Policy: https://zylalabs.com/terms#refund
Service Level:
100%
Response Time:
142ms
Service Level:
100%
Response Time:
889ms
Service Level:
100%
Response Time:
614ms
Service Level:
100%
Response Time:
445ms
Service Level:
100%
Response Time:
342ms
Service Level:
100%
Response Time:
169ms
Service Level:
100%
Response Time:
159ms
Service Level:
100%
Response Time:
1,206ms
Service Level:
100%
Response Time:
146ms
Service Level:
100%
Response Time:
789ms