v1
latestOpenAPI 3.1.02026-08-0420183200.9 KBRouting
Calculate a time distance matrix for use in an optimizer.
The time distance matrix API lets you compare travel times between a set of possible start and end points. See https://docs.stadiamaps.com/limits/ for documentation of our latest limits.
post/matrix/v1
Request body
Example request
{
"costing": "pedestrian",
"sources": [
{
"lat": 40.744014,
"lon": -73.990508
}
],
"targets": [
{
"lat": 40.744014,
"lon": -73.990508
},
{
"lat": 40.739735,
"lon": -73.979713
},
{
"lat": 40.752522,
"lon": -73.985015
},
{
"lat": 40.750117,
"lon": -73.983704
},
{
"lat": 40.750552,
"lon": -73.993519
}
]
}Response
A matrix of times and distances between the start and end points.
Example response
{
"sources": [
[
{
"lat": 40.744014,
"lon": -73.990508
}
]
],
"sources_to_targets": [
[
{
"distance": 0,
"from_index": 0,
"time": 0,
"to_index": 0
},
{
"distance": 1.115,
"from_index": 0,
"time": 806,
"to_index": 1
},
{
"distance": 1.278,
"from_index": 0,
"time": 909,
"to_index": 2
},
{
"distance": 1.112,
"from_index": 0,
"time": 792,
"to_index": 3
},
{
"distance": 1.22,
"from_index": 0,
"time": 869,
"to_index": 4
}
]
],
"targets": [
[
{
"lat": 40.744014,
"lon": -73.990508
},
{
"lat": 40.739735,
"lon": -73.979713
},
{
"lat": 40.752522,
"lon": -73.985015
},
{
"lat": 40.750117,
"lon": -73.983704
},
{
"lat": 40.750552,
"lon": -73.993519
}
]
],
"units": "kilometers"
}