With the Distance Metrics API, users can effortlessly retrieve the distance between two geographic points. Leveraging advanced algorithms and mapping technologies, the API computes the shortest distance across Earth's surface, factoring in elements like road networks, terrain, and geographical barriers.
Moreover, the Distance Metrics API is engineered for scalability and efficiency, capable of managing high volumes of requests with minimal delay. Its scalability ensures adaptability to the demands of users, spanning from small startups to large corporations.
In summary, the Distance Metrics API provides a comprehensive solution for distance computation between locations. With its user-friendly interface, adaptable output options, reliability, and scalability, the API emerges as an indispensable tool. Whether for trip planning, logistics optimization, or location-based services development, the Distance Calculator API furnishes precise distance data essential for success.
It will receive a parameter and provide you with a JSON.
Besides the number of API calls, there is no other limitation.
To use this endpoint you must indicate 2 locations in the parameter.
Calculate Distances - Endpoint Features
| Object | Description |
|---|---|
location1 |
[Required] Indicates the first location |
location2 |
[Required] Indicates the second location |
{
"distance": 12222.74218872189,
"unit": "kilometers",
"location1": {
"place_id": 145369277,
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
"osm_type": "relation",
"osm_id": 406091,
"lat": "59.9133301",
"lon": "10.7389701",
"class": "boundary",
"type": "administrative",
"place_rank": 11,
"importance": 0.71373169654299,
"addresstype": "city",
"name": "Oslo",
"display_name": "Oslo, Norway",
"address": {
"city": "Oslo",
"ISO3166-2-lvl4": "NO-03",
"country": "Norway",
"country_code": "no"
},
"boundingbox": [
"59.8093113",
"60.1351064",
"10.4891652",
"10.9513894"
]
},
"location2": {
"place_id": 15312163,
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
"osm_type": "relation",
"osm_id": 1224652,
"lat": "-34.6037181",
"lon": "-58.38153",
"class": "boundary",
"type": "administrative",
"place_rank": 16,
"importance": 0.7279817834797908,
"addresstype": "city",
"name": "Buenos Aires",
"display_name": "Buenos Aires, Comuna 1, Autonomous City of Buenos Aires, Argentina",
"address": {
"city": "Buenos Aires",
"ISO3166-2-lvl8": "AR-C",
"state_district": "Comuna 1",
"state": "Autonomous City of Buenos Aires",
"ISO3166-2-lvl4": "AR-C",
"country": "Argentina",
"country_code": "ar"
},
"boundingbox": [
"-34.7056370",
"-34.5265535",
"-58.5314494",
"-58.3351423"
]
}
}
curl --location --request GET 'https://zylalabs.com/api/3850/distance+metrics+api/4497/calculate+distances?location1=Oslo&location2=Buenos Aires' --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.
Users must indicate 2 locations to measure the distance.
The Distance Estimation API allows users to calculate the distance between two geographic locations.
There are different plans to suit all tastes, including a free trial for a small number of requests, but your rate is limited to avoid abuse of the service.
Zyla provides a wide range of integration methods for almost all programming languages. You can use these codes to integrate with your project as you need.
The Distance Metrics API returns a JSON object containing the calculated distance between two locations, along with details about each location, such as coordinates, place IDs, and geographical classifications.
Key fields in the response include "distance" (numeric value), "unit" (measurement unit), and detailed information for "location1" and "location2," including latitude, longitude, and place names.
The response data is structured as a JSON object with a top-level distance metric, unit of measurement, and nested objects for each location containing relevant geographical details.
The primary parameter required is the two locations for which the distance is to be calculated. These can be specified using place IDs, coordinates, or addresses.
Data accuracy is maintained through the use of advanced algorithms and reliable mapping technologies, sourcing data from trusted providers like OpenStreetMap to ensure precise distance calculations.
Typical use cases include route planning for deliveries, logistics optimization between warehouses, travel distance estimation, fitness tracking, and real estate analysis for proximity to amenities.
Users can utilize the returned data to inform decision-making in logistics, enhance travel planning, or integrate distance metrics into applications for improved user experience and functionality.
The endpoint provides distance measurements, geographical coordinates, place IDs, and additional metadata about each location, enabling comprehensive analysis for various applications.
Please have a look at our Refund Policy: https://zylalabs.com/terms#refund
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.
Service Level:
100%
Response Time:
590ms
Service Level:
100%
Response Time:
342ms
Service Level:
100%
Response Time:
889ms
Service Level:
100%
Response Time:
445ms
Service Level:
100%
Response Time:
142ms
Service Level:
100%
Response Time:
1,063ms
Service Level:
100%
Response Time:
127ms
Service Level:
100%
Response Time:
614ms
Service Level:
100%
Response Time:
206ms
Service Level:
100%
Response Time:
487ms