Matrix API Reference
Base URL
https://routing.maptoolkit.net
Endpoints
GET /matrix
Calculate a travel time and distance matrix
Returns a 2D matrix of travel times and distances for all combinations of from and to coordinates.
Times are in seconds, distances are in meters.
Distances are not available for routeType=transit.
If a route cannot be found, the value is null.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
from | query | array | Yes | Origin coordinate in lat,lng format. Repeat to specify multiple origins. |
routeType | query | string | Yes | Travel mode. Accepted values are car, bike, foot, and transit. One of: car, bike, foot, transit. |
to | query | array | Yes | Destination coordinate in lat,lng format. Repeat to specify multiple destinations. |
callback | query | string | No | Wraps the response in a JSONP callback function with this name. |
departure | query | string | No | Departure time for transit routing as an ISO 8601 date-time string. Default: current time. |
vehicle | query | string | No | Deprecated. Use routeType instead. One of: car, bike, foot, transit. |
| Status | Description |
|---|---|
200 | Travel time and distance matrix. |
400 | Bad request. Transit errors
Profile errors
General errors
|
500 | Internal server error. |
POST /matrix
Calculate a travel time and distance matrix (POST)
Same as GET but accepts parameters in the request body. Useful when querying many origins or destinations.
| Status | Description |
|---|---|
200 | Travel time and distance matrix. |
400 | Bad request. Transit errors
Profile errors
General errors
|
500 | Internal server error. |
Try it
The console below sends live requests against the endpoints above. You can browse it
without an API key; Execute needs one, because every endpoint requires the api_key
query parameter and returns 403 without it. Use Authorize to add your key. See
First Steps if you do not have one yet.