distance matrix API

The Distance Matrix API

Calculate, evaluate and plan your routes to improve your customers' online experience and enhance your business efficiency

Main API features

real-time traffic
Real-time traffic
Our Distance Matrix API provides the route duration, taking into account real-time traffic conditions
driving distance calculator
Travel modes
Distance is calculated to account for users who are driving, walking, bicycling, or using public transport
drive time forecasting
Forecasting
The Distance Matrix API can forecast travel times, taking into account departure and arrival times
quick response
Quick response
The request calculation time is up to 50 elements per second, so you can get the API response less than in a second

How it works

The Matrix API returns the trip duration in seconds and the distance in meters to show the fastest route between the coordinates of the selected points.
distance between places
The task
For example, let's say you need to find the distance and travel time between the following address points on the map:
1677 Easton Rd, Willow Grove, PA 19090, USA
119 S Easton Rd, Glenside, PA 19038, USA
geocoding API
API geocode
The API geocode returns these queries as point coordinates:
40.1349979,-75.1228148
40.1000254,-75.1540458
time and distance calculator
The result
The Distance Matrix API then returns distance and travel time data on the queries with point coordinates. The API response contains a distance matrix in JSON format.
For example, 310 meters and 2600 seconds
Find out how easy it is to migrate to the Distance Matrix API
Distance Matrix AI
Migrate

What industries benefit from this API?

We can optimize your delivery economics and improve your business efficiency, whether your business is about food delivery, ride-hailing services, or complicated logistical platforms.

Information for developers

The Distance Matrix API's request-and-response format is similar to Google's Distance Matrix API. Migrating it is easy.
Example:
https://api.distancematrix.ai/distancematrix?origins=51.4822656,-0.1933769&destinations=51.4994794,-0.1269979&key=<your_access_token>
Copied!
Response:
{
  "destination_addresses": [
    "Westminster Abbey, Westminster, London SW1P 3PA, UK"
  ],
  "origin_addresses": [
    "Chapel, Fulham, London SW6 1BA, UK"
  ],
  "rows": [
    {
      "elements": [
        {
          "distance": {
            "text": "4.7 miles",
            "value": 7563.898
          },
          "duration": {
            "text": "31 min",
            "value": 1860.0
          },
          "duration_in_traffic": {
            "text": "31 min",
            "value": 1860.0
          },
          "status": "OK"
        }
      ]
    }
  ],
  "status": "OK"
}
Copied!
No prepayment is needed.
Start for free and get instant
access to all Distancematrix.ai
products and features