Pairs Directions API
OpenAPI Specification
2GIS Navigation API (6.0.0)
Building multiple routes
Build multiple routes in a single call. Each route must consist of two points.
path Parameters
routing_type required | string Enum: "driving" "walking" "taxi" "bicycle" Routing type:
|
query Parameters
key required | string Developer API key |
Request Body schema: */*
Request parameters
required | Array of objects (RequestPoints) Array of routes. Can consist of up to 50 routes. |
type required | string (schemas) 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. | |
OutputType (string) or null | |
integer or null <long> Date and time to use instead of the current date and time. Specified as Unix time. | |
Array of objects (ExcludeObject) An array of areas to avoid when building a route. Not more than 25 areas. |
Responses
Response Schema: application/json
status required | string (schemas) Enum: "OK" "FAIL" "POINT_EXCLUDED" "ROUTE_NOT_FOUND" "ROUTE_DOES_NOT_EXISTS" "ATTRACT_FAIL" Request status:
|
lat1 required | number <double> >= 0 Latitude of the point of departure. |
lon1 required | number <double> >= 0 Longitude of the point of departure. |
lat2 required | number <double> >= 0 Longitude of the point of arrival. |
lon2 required | number <double> >= 0 Longitude of the point. |
integer or null Route length in meters. | |
integer or null Estimated travel time in seconds. | |
number or null Accuracy of the route as a number from 0 to 1 (if | |
boolean or null If true, the route includes closed roads. | |
string or null Error message | |
string or null Route geometry in WKT format in case of full output. Empty string in case of simplified output. |
Response Schema: application/json
type required | string (schemas) Enum: "result" "error" Response type:
|
string or null Detailed error message. |
Response samples
- 200
- 400
[- {
- "distance": 10838,
- "duration": 1505,
- "lat1": 55.102268,
- "lat2": 55.032594,
- "lon1": 82.933328,
- "lon2": 82.958722,
- "status": "OK"
}, - {
- "distance": 14586,
- "duration": 1956,
- "lat1": 55.079794,
- "lat2": 54.981836,
- "lon1": 82.92952,
- "lon2": 82.907189,
- "status": "OK"
}
]