Calculate walking time/distance matrix
Calculate distance and duration matrices between multiple coordinates for pedestrian routing. Compatible with OSRM matrix API.
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
sources | string | Semicolon-separated indices of source coordinates (0-based) | 0;1 | |
destinations | string | Semicolon-separated indices of destination coordinates (0-based) | 0;1 | |
annotations | string | Annotations to include in response Values: duration, distance, duration,distance | duration,distance |
Try It Out
https://capi.busmaps.com:8443Popular parameters
curl -H "capi-key: Bearer YOUR_API_KEY" \
-H "capi-host: busmaps.com" \
"https://capi.busmaps.com:8443/pedestrian/matrix/-0.155956,51.540343;-0.069214,51.512959?sources=0;1&destinations=0;1&annotations=duration,distance"Response Example
HTTP 200 - Success
{
"code": "Ok",
"sources": [
{
"hint": "wwLgpbUD4KUJAAAAFAAAAGcDAACIAAAApiyhP-2WNEAHNPNCZ86XQQkAAAAUAAAAZwMAAIgAAABBAAAAzJ79_3dxEgPvn_3_A3ISAw0ALxR6vxoo",
"distance": 25.505499,
"name": "Chalcot Crescent",
"location": [
-0.155956,
51.540343
]
},
{
"hint": "3V3dpRtk3aVwAAAAcgAAAPIBAAAAAAAAOP57QTj-e0HTbopCAAAAAHAAAAByAAAA8gEAAAAAAABBAAAAovH-_38GEgNP8f7_6AYSAwIA_wN6vxoo",
"distance": 13.025276,
"name": "",
"location": [
-0.069214,
51.512959
]
},
{
"hint": "nvPipR754qVrAAAAcQAAAAAAAAAAAAAAtW5uQeXGe0EAAAAAAAAAAGsAAABxAAAAAAAAAAAAAABBAAAA4gz-_4rwEQPyDP7_l_ARAwAA_wd6vxoo",
"distance": 1.823494,
"name": "",
"location": [
-0.127774,
51.507338
]
}
],
"destinations": [
{
"hint": "wwLgpbUD4KUJAAAAFAAAAGcDAACIAAAApiyhP-2WNEAHNPNCZ86XQQkAAAAUAAAAZwMAAIgAAABBAAAAzJ79_3dxEgPvn_3_A3ISAw0ALxR6vxoo",
"distance": 25.505499,
"name": "Chalcot Crescent",
"location": [
-0.155956,
51.540343
]
},
{
"hint": "3V3dpRtk3aVwAAAAcgAAAPIBAAAAAAAAOP57QTj-e0HTbopCAAAAAHAAAAByAAAA8gEAAAAAAABBAAAAovH-_38GEgNP8f7_6AYSAwIA_wN6vxoo",
"distance": 13.025276,
"name": "",
"location": [
-0.069214,
51.512959
]
},
{
"hint": "nvPipR754qVrAAAAcQAAAAAAAAAAAAAAtW5uQeXGe0EAAAAAAAAAAGsAAABxAAAAAAAAAAAAAABBAAAA4gz-_4rwEQPyDP7_l_ARAwAA_wd6vxoo",
"distance": 1.823494,
"name": "",
"location": [
-0.127774,
51.507338
]
}
],
"durations": [
[
0,
5769.3,
3388
],
[
5769.3,
0,
3337
],
[
3388,
3337,
0
]
],
"distances": [
[
0,
7981,
4692.4
],
[
7981,
0,
4627.8
],
[
4692.4,
4627.8,
0
]
]
}Response Schema
Title: Pedestrian Matrix Response View Full JSON Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Pedestrian Matrix Response",
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Status code for the response"
},
"sources": {
"type": "array",
"items": {
"type": "object",
"properties": {
"hint": {
"type": "string",
"description": "Opaque OSRM hint for re-snapping the waypoint"
},
"distance": {
"type": "number",
"description": "Distance in meters"
},
"location": {
"type": "array",
"items": {
"type": "number"
},
"description": "Coordinate pair of the point"
},
"name": {
"type": "string",
"description": "Display name"
}
},
"required": [
"hint",
"location",
"distance"
]
},
"description": "Source waypoints of the matrix"
},
"destinations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"hint": {
"type": "string",
"description": "Opaque OSRM hint for re-snapping the waypoint"
},
"distance": {
"type": "number",
"description": "Distance in meters"
},
"location": {
"type": "array",
"items": {
"type": "number"
},
"description": "Coordinate pair of the point"
},
"name": {
"type": "string",
"description": "Display name"
}
},
"required": [
"hint",
"location",
"distance"
]
},
"description": "Destination waypoints of the matrix"
},
"durations": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": [
"integer",
"number"
]
}
},
"description": "Matrix of durations in seconds"
},
"distances": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": [
"integer",
"number"
]
}
},
"description": "Matrix of distances in meters"
}
},
"required": [
"code",
"sources",
"destinations",
"durations",
"distances"
]
}
Response Codes
Successful matrix calculation
Invalid input parameters
No table could be constructed