Timings API
Timings API
The Timings API estimates travel times for a route based on distance and elevation. It returns separate estimates for walking, cycling, off-road cycling, and racing cycling.
Base URL
https://enhance.maptoolkit.netAuthentication
Add your API key as ?api_key=YOUR_API_KEY to every request. See Authentication for details.
Get Travel Time Estimates
Endpoint:
GET https://enhance.maptoolkit.net/route
POST https://enhance.maptoolkit.net/routeUse a POST request when the geometry is large.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
timings | 1 | Yes | Set to 1 to include timings in the response. |
geometry | GeoJSON string | Yes (or gpx/kml) | A GeoJSON LineString or MultiLineString. |
gpx | URL | Yes (or geometry/kml) | URL to a GPX file. |
kml | URL | Yes (or geometry/gpx) | URL to a KML file. |
cache | 0 or 1 | No | Use cached results if available. Default: 1. |
callback | string | No | Wrap the response in a JSONP callback. |
Example
GET https://enhance.maptoolkit.net/route?geometry={"type":"LineString","coordinates":[[10,50],[10.1,50.1]]}&timings=1&api_key=YOUR_API_KEYResponse:
{
"geometry": {
"type": "MultiLineString",
"coordinates": [[...]]
},
"timings": [{
"walking": 300,
"cycling": 100,
"cycling_offroad": 110,
"cycling_racing": 50
}]
}Times are in seconds. The timings array contains one entry per segment of the MultiLineString.
| Field | Description |
|---|---|
walking | Estimated walking time in seconds. |
cycling | Estimated road cycling time in seconds. |
cycling_offroad | Estimated off-road cycling time in seconds. |
cycling_racing | Estimated racing cycling time in seconds. |