POST /get_dist_matrix
OpenAPI Specification
2GIS Navigation API (6.0.0)
Getting information about travel distance and time between points.
Getting information about travel distance and time between points.
query Parameters
key required | string Developer API key |
version required | string Default: "2.0" API version |
response_format | string Default: "json" Enum: "protobuf" "json" Response format:
|
Request Body schema: */*
Request parameters
required | Array of objects (RequestPoint) non-empty An array of points. |
sources required | Array of integers non-empty Which points from the |
targets required | Array of integers non-empty Which points from the |
string or null Date and time to use instead of the current date and time. Specified in RFC 3339 format (e.g., 2020-05-15T15:52:01Z). | |
transport | string Default: "driving" Enum: "driving" "taxi" "truck" "walking" "bicycle" Routing type:
|
type | string Default: "jam" Enum: "jam" "statistics" "shortest" Route type:
|
Array of RequestFilter (strings) or RequestFilter (string) or null | |
boolean or null If true, the route may include driving on closed roads. | |
Array of objects (ExcludeObject) An array of areas to avoid when building a route. Not more than 25 areas. | |
TruckParams (object) or null | |
number or null Average speed limit, km/h | |
pass_zone_pass_ids | Array of integers Default: [] Identifier of a pass for a zone (array of numbers). |
Responses
Response Schema: application/json
Array of RoutesItem (objects) or null An array of found routes. For each successive pair of points, there is exactly one route.Thus, in the case of P-P, there will be one route here, but in general there will be N-1 routes for N points. |
Response samples
- 200
{- "routes": [
- {
- "status": "FAIL",
- "source_id": 0,
- "target_id": 0,
- "distance": 0,
- "duration": 0,
- "reliability": 1,
- "are_locked_roads_ignored": true
}
]
}