POST /get_dist_matrix
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" Value: "json" Response format:
|
Request Body schema: */*required
Request parameters
required | Array of objects (RequestPoint) non-empty An array of points. |
| sources required | Array of integers non-empty [ items >= 0 ] Which points from the |
| targets required | Array of integers non-empty [ items >= 0 ] Which points from the |
string or Array of strings 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" "scooter" "motorcycle" "public_transport" Routing type:
|
RequestType (string) or null Default: "jam" 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). |
boolean or null If true, altitude information will be included in the response. | |
PublicTransportParams (object) or null Public transport parameters. |
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 for each start time. 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. | |||||||||||||||||||||
Any of Array
| |||||||||||||||||||||
Response samples
- 200
{- "routes": [
- {
- "status": "FAIL",
- "source_id": 0,
- "target_id": 0,
- "distance": 0,
- "duration": 0,
- "reliability": 1,
- "are_locked_roads_ignored": true,
- "altitudes_info": {
- "elevation_gain": 0,
- "elevation_loss": 0,
- "max_altitude": 0,
- "max_road_angle": 0,
- "min_altitude": 0
}, - "public_transport_info": "string",
- "start_time": 0
}
]
}