Solutions
Developer guide
Pricing
Sign in
Get a free trial
Products
Solutions
Cases
Developer guide
Pricing
Contact us
Contact us
The Geocoding API (Beta)
The Distance Matrix API
The Geocoding API (Beta)

Migrate to Distance Matrix AI

The Distance Matrix API

Introduction
This document will guide you through the different request and response parameters of Distance Matrix API and how you can extract data analogous to the Google Distance Matrix service from Distance Matrix API with the same accuracy, but for the more affordable and fair price.
Distance Matrix request
Google:
GET
https://maps.googleapis.com/maps/api/distancematrix/json
?origins=<origin_location_1|origin_location_2|...|origin_location_n>
&destinations=<destination_location_1|destination_location_2|...|destination_location_n>
&key=<your_access_token>
Distancematrix.ai:
GET
https://api.distancematrix.ai/maps/api/distancematrix/json
?origins=<origin_location_1|origin_location_2|...|origin_location_n>
&destinations=<destination_location_1|destination_location_2|...|destination_location_n>
&key=<your_access_token>
Distance Matrix request
Google:
GET
https://maps.googleapis.com/maps/api/ distancematrix/json?origins=<origin_location_1|origin_location_2 |...|origin_location_n>&destinations= <destination_location_1|destination_location_2 |...|destination_location_n>
&key=<your_access_token>
Distancematrix.ai:
GET
https://api.distancematrix.ai/maps/api/ distancematrix/json?origins= <origin_location_1|origin_location_2 |...|origin_location_n>&destinations= <destination_location_1|destination_location_2 |...|destination_location_n>
&key=<your_access_token>
Distance Matrix request
Google:
GET
https://maps.googleapis.com/maps/api/distancematrix/json
?origins=51.4822656,-0.1933769
&destinations=Westminster Abbey, Westminster, London SW1P 3PA, UK
&key=<your_access_token>
Distancematrix.ai:
GET
https://api.distancematrix.ai/maps/api/distancematrix/json
?origins=51.4822656,-0.1933769
&destinations=Westminster Abbey, Westminster, London SW1P 3PA, UK
&key=<your_access_token>
Distance Matrix request
Google:
GET
https://maps.googleapis.com/maps/api/ distancematrix/json?origins=51.4822656, -0.1933769&destinations=Westminster Abbey, Westminster, London SW1P 3PA, UK
&key=<your_access_token>
Distancematrix.ai:
GET
https://api.distancematrix.ai/maps/api/ distancematrix/json?origins=51.4822656, -0.1933769&destinations=Westminster Abbey, Westminster, London SW1P 3PA, UK
&key=<your_access_token>
Required & Response parameters
The unit of value of durations is second.
The unit of value of distances is meter.
Parameters in a request (part of the URL) is the same in both cases:
Meant for car routing to get the duration considering live traffic.
The coordinates pairs on which route is to be calculated. Minimum two pairs needed.
Response in JSON format (is the same in both cases):
1. list of origin locations (source <longitude,latitude> location coordinates or address) separated with vertical bar "|").
2. list of destination locations (source <longitude,latitude> location coordinates or address) separated with vertical bar "|").
3. key (your access token authorized to access the resource).
Distance Matrix example response
Google:
GET
Distancematrix.ai:
GET
{ "destination_addresses": [ "Westminster Abbey, Westminster, London SW1P 3PA, UK" ], "origin_addresses": [ "Chapel, Fulham, London SW6 1BA, UK" ], "rows": [ { "distance": { "text": "4.7 mi", "value": 7564 }, "duration": { "text": "28 mins", "value": 1680 }, "duration_in_traffic": { "text": "28 mins", "value": 1680 }, "status": "OK" } ], "status": "OK" }
{ "destination_addresses": [ "Westminster Abbey, Westminster, London SW1P 3PA, UK" ], "origin_addresses": [ "Chapel, Fulham, London SW6 1BA, UK" ], "rows": [ { "distance": { "text": "4.7 mi", "value": 7564 }, "duration": { "text": "28 mins", "value": 1680 }, "duration_in_traffic": { "text": "28 mins", "value": 1680 }, "status": "OK" } ], "status": "OK" }
Do you need more information
about the Distance Matrix API?
The Distance Matrix API
The API accounts for traffic conditions, different travel modes, and includes a departure and arrival time option to build forecasts. Unlimited matrix size
The Distance Matrix API Documentation
Instruction for developers on Distance Matrix requests and responses. Easy migration from Google API, free trial, and flexible rate plans
No credit card required. Cancel anytime!
Start a free 7-day trial of the Distance Matrix API for Business
Get my 7-days free trial
Learn more about our pricing
Get my 7-days free trial
Learn more about our pricing