The Distance Matrix API

Calculate, evaluate and plan your routes to improve customer experience and business efficiency
Main API Features
Real-time traffic
Accounts for traffic conditions, traffic jams, and restrictions
Travel modes
Distances are calculated to account for driving, walking, or bicycling
Forecasting
Departure and arrival time option is used to create a forecast
Unlimited matrix size
From 2500 in basic plan and unlimited in pro
How it works
The Matrix API returns the duration in seconds and the distance in meters for the fastest route between the coordinates of the selected points.
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
API geocode
The API geocode returns these queries as point coordinates. It is necessary to obtain the distances between points in a straight line or determine whether the user is in a certain zone.

40.1349979,-75.1228148
40.1000254,-75.1540458
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
Who can benefit from this API?
Enhance your website or mobile app with the API that will improve customer experience and business efficiency, including for:
Our case studies
Information for developers
The request and response format of the Distance Matrix API is similar to Google's Distance Matrix API, and its migration is easy.
Example:

GET
https://api.distancematrix.ai/distancematrix?origins=51.4822656,-0.1933769&destinations=51.4994794,-0.1269979&key=<your_access_token>
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",
}
Start a free 7-day trial of the Distance Matrix API for Business
No credit card required, cancel any time