{"openapi":"3.1.0","info":{"title":"REST API Mapy.com routing methods","description":"Service for finding/planning a route between two or more points. \n\nApi is based on common principles described in the document [Common principles of REST API Mapy.com](/v1/docs/commons/)","version":"2.1.12"},"paths":{"/v1/routing/route":{"get":{"tags":["routing"],"summary":"Service for finding/planning a route between two points, optionally via up to fifteen waypoints.","description":"Service for finding/planning a route between two points, optionally via up to fifteen waypoints. The result of the planner call is the length of the found route, the estimated duration according to the selected mode of transport and the geometry of the route in the selected format. If it is not possible to plan the route for the selected mode of transport, the service will return http response code ``404``. The cause of the error is described in the response body: \n```json\n{\n   \"detail\": [\n       {\n           \"msg\": \"Edge not found\",\n           \"errorCode\": 7,\n       }\n   ]\n}\n```\n### Possible routing errors: \n* ``errorCode: 7`` - the route point is outside the available route network for the selected type of transport.\n* ``errorCode: 9`` - the route point is located in an area to which is not connected by the selected mode of transport. For example, another continent.\n\n Maximum rate limit 30 requests per second.","operationId":"basic_route_v1_routing_route_get","parameters":[{"description":"Coordinates of the beginning of the route. An array of two float numbers. The first number is ``longitude``, the second is ``latitude``. Supports exploded ``?start=14.40094&start=50.0711`` and unexploded ``?start=14.40094,50.0711`` format.","required":true,"schema":{"items":[{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Longitude"},{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Latitude"}],"type":"array","maxItems":2,"minItems":2,"title":"Start","description":"Coordinates of the beginning of the route. An array of two float numbers. The first number is ``longitude``, the second is ``latitude``. Supports exploded ``?start=14.40094&start=50.0711`` and unexploded ``?start=14.40094,50.0711`` format."},"example":[14.40094,50.0711],"name":"start","in":"query"},{"description":"Coordinates of the end of the route. An array of two float numbers. The first number is ``longitude``, the second is ``latitude``. Supports exploded ``?end=14.40094&end=50.0711`` and unexploded ``?end=14.40094,50.0711`` format.","required":true,"schema":{"items":[{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Longitude"},{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Latitude"}],"type":"array","maxItems":2,"minItems":2,"title":"End","description":"Coordinates of the end of the route. An array of two float numbers. The first number is ``longitude``, the second is ``latitude``. Supports exploded ``?end=14.40094&end=50.0711`` and unexploded ``?end=14.40094,50.0711`` format."},"example":[16.5990122,49.1718222],"name":"end","in":"query"},{"description":"Route type","required":true,"schema":{"allOf":[{"$ref":"#/components/schemas/RouteType"}],"description":"Route type"},"name":"routeType","in":"query"},{"description":"Optional language code. The parameter supports two-letter language code ``?lang=cs``.","required":false,"schema":{"allOf":[{"$ref":"#/components/schemas/Language"}],"description":"Optional language code. The parameter supports two-letter language code ``?lang=cs``.","default":"cs"},"name":"lang","in":"query"},{"description":"Optional geometry format.","required":false,"schema":{"allOf":[{"$ref":"#/components/schemas/GeometryFormat"}],"description":"Optional geometry format.","default":"geojson"},"name":"format","in":"query"},{"description":"Optional parameter to avoid toll roads.","required":false,"schema":{"type":"boolean","title":"Avoidtoll","description":"Optional parameter to avoid toll roads.","default":false},"name":"avoidToll","in":"query"},{"description":"Optional parameter to avoid highways.","required":false,"schema":{"type":"boolean","title":"Avoidhighways","description":"Optional parameter to avoid highways.","default":false},"name":"avoidHighways","in":"query"},{"description":"Departure local time for route planning in ISO-8601 format. ``?departure=2025-01-01T00:00:00.000``","required":false,"schema":{"type":"string","format":"date-time","title":"Departure","description":"Departure local time for route planning in ISO-8601 format. ``?departure=2025-01-01T00:00:00.000``"},"name":"departure","in":"query"},{"description":"Up to 15 optional waypoint coordinates between start and end.  The parameter supports a semicolon-separated list of coordinates ``?waypoints=14.4009400,50.0711000;14.3951303,50.0704094``, or exploded array of coordinates ``?waypoints=14.4009400,50.0711000&waypoints=14.3951303,50.0704094``. The waypoint coordinates are two float numbers separated by a comma in the order ``longitude``, ``latitude``.","required":false,"schema":{"items":{"type":"string"},"type":"array","maxItems":15,"minItems":0,"title":"Waypoints","description":"Up to 15 optional waypoint coordinates between start and end.  The parameter supports a semicolon-separated list of coordinates ``?waypoints=14.4009400,50.0711000;14.3951303,50.0704094``, or exploded array of coordinates ``?waypoints=14.4009400,50.0711000&waypoints=14.3951303,50.0704094``. The waypoint coordinates are two float numbers separated by a comma in the order ``longitude``, ``latitude``."},"example":["15.5903861, 49.3967233","16.4187328, 49.3414642"],"name":"waypoints","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RoutingResponse"},{"$ref":"#/components/schemas/RoutingErrorResponse"}],"title":"Response Basic Route V1 Routing Route Get"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"In case it is not possible to plan a route according to the selected parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/routing/matrix-m":{"get":{"tags":["routing"],"summary":"Service for finding the length and duration for matrix of starts and ends.","description":"Service for finding the length and duration for matrix of starts and ends in case for NxM matrix routing or full matrix of starts in case for NxN matrix routing. Maximum size of the matrix is the length of `starts` coordinates multiplied by the length of `ends` coordinates or the length of `starts` coordinates to power of two (full combination), currently the matrix size is limited to 100 i.e. 1x100 or 10x10 or 2x50 etc. The maximum distance between the two points is limited to 500 km by the air. The result of the planner call is a matrix of the length and duration of the routes between the selected starts and ends. In a case where it is not possible to plan the route for the selected mode of transport, or in a case of any other error, the service will return appropriate set of matrix errors results. Example of the response body: \n```json\n{\n   \"matrix\": [\n       [\n           {\n               \"length\": -3,\n               \"duration\": -3\n           },\n           {\n               \"length\": 2351,\n               \"duration\": 189 \n           }\n       ]\n   ]\n}\n```\n### Possible matrix errors: \n* ``-1`` - the general error \n* ``-2`` - the route points are too far apart\n* ``-3`` - the route could not be found i.e. point too far from routing network \n* ``-4`` - the internal timeout of the service has been reached\n\n In a case of any other error, the service will return http response code ``404``. The cause of the error is described in the response body: \n```json\n{\n   \"detail\": [\n       {\n           \"msg\": \"Disconnected areas\",\n           \"errorCode\": 9\n       }\n   ]\n}\n```\n### Possible routing errors: \n* ``errorCode: 7`` - the route point is outside the available route network for the selected type of transport.\n* ``errorCode: 9`` - the route point is located in an area to which is not connected by the selected mode of transport. For example, another continent.\n\n Maximum rate limit 30 requests per second.","operationId":"matrix_m_v1_routing_matrix_m_get","parameters":[{"description":"Coordinates of the beginning of the route. An array of two float numbers. The first number is ``longitude``, the second is ``latitude``. Supports a semi-colon-separated list of coordinates ``?starts=14.40094,50.0711;14.3951303,50.0704094`` or exploded array of coordinates ``?starts=14.40094,50.0711&starts=14.3951303,50.0704094``. The starts parameter is required for the matrix endpoint. The number of starts must be at least 2 (for NxN routing) and 1 (for NxM routing). The maximum number of starts is 100. The maximum number of ends is 100. The maximum number of starts multiplied by the maximum number of ends cannot exceed 100.","required":true,"schema":{"items":{"type":"string"},"type":"array","maxItems":100,"minItems":1,"title":"Starts","description":"Coordinates of the beginning of the route. An array of two float numbers. The first number is ``longitude``, the second is ``latitude``. Supports a semi-colon-separated list of coordinates ``?starts=14.40094,50.0711;14.3951303,50.0704094`` or exploded array of coordinates ``?starts=14.40094,50.0711&starts=14.3951303,50.0704094``. The starts parameter is required for the matrix endpoint. The number of starts must be at least 2 (for NxN routing) and 1 (for NxM routing). The maximum number of starts is 100. The maximum number of ends is 100. The maximum number of starts multiplied by the maximum number of ends cannot exceed 100."},"example":["14.40094,50.0711","14.3951303,50.0704094"],"name":"starts","in":"query"},{"description":"Coordinates of the end of the route. An array of two float numbers. The first number is ``longitude``, the second is ``latitude``. Supports a semi-colon-separated list of coordinates ``?ends=14.40194,50.0721;14.3961303,50.0714094`` or exploded array of coordinates ``?ends=14.40194,50.0721&ends=14.3961303,50.0714094``. The ends parameter is optional for the matrix endpoint when the certain number of starts is specified. The maximum number of starts is 100. The maximum number of ends is 100. The maximum number of starts multiplied by the maximum number of ends cannot exceed 100.","required":false,"schema":{"items":{"type":"string"},"type":"array","maxItems":100,"minItems":0,"title":"Ends","description":"Coordinates of the end of the route. An array of two float numbers. The first number is ``longitude``, the second is ``latitude``. Supports a semi-colon-separated list of coordinates ``?ends=14.40194,50.0721;14.3961303,50.0714094`` or exploded array of coordinates ``?ends=14.40194,50.0721&ends=14.3961303,50.0714094``. The ends parameter is optional for the matrix endpoint when the certain number of starts is specified. The maximum number of starts is 100. The maximum number of ends is 100. The maximum number of starts multiplied by the maximum number of ends cannot exceed 100."},"example":["14.40194,50.0721","14.3961303,50.0714094"],"name":"ends","in":"query"},{"description":"Route type","required":true,"schema":{"allOf":[{"$ref":"#/components/schemas/RouteType"}],"description":"Route type"},"name":"routeType","in":"query"},{"description":"Optional parameter to avoid toll roads.","required":false,"schema":{"type":"boolean","title":"Avoidtoll","description":"Optional parameter to avoid toll roads.","default":false},"name":"avoidToll","in":"query"},{"description":"Optional language code. The parameter supports two-letter language code ``?lang=cs``.","required":false,"schema":{"allOf":[{"$ref":"#/components/schemas/Language"}],"description":"Optional language code. The parameter supports two-letter language code ``?lang=cs``.","default":"cs"},"name":"lang","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/MatrixRoutingResponse"},{"$ref":"#/components/schemas/ErrorResponse"}],"title":"Response Matrix M V1 Routing Matrix M Get"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"In case it is not possible to plan a route according to the selected parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Coordinates":{"items":{"type":"number"},"type":"array","minItems":2,"title":"Coordinates","description":"An array of two float numbers. The first number is ``longitude``, the second is ``latitude``.","example":[14.40094,50.0711]},"EnclosedTrafficArea":{"enum":["NO_ENTRY","RESTRICTED_ENTRY","PEDESTRIAN_ZONE","CLOSURE","OTHER_RESTRICTION"],"title":"EnclosedTrafficArea","description":"An enumeration."},"ErrorResponse":{"properties":{"detail":{"items":{},"type":"array","title":"Error detail"}},"type":"object","required":["detail"],"title":"ErrorResponse"},"FeatureType":{"enum":["Feature"],"title":"FeatureType","description":"An enumeration."},"GeoJSONGeometry":{"properties":{"type":{"allOf":[{"$ref":"#/components/schemas/FeatureType"}],"description":"GeoJSON feature type"},"geometry":{"allOf":[{"$ref":"#/components/schemas/GeoJSONLineString"}],"title":"Geometry","description":"GeoJSON geometry"},"properties":{"type":"object","title":"Properties","default":{}}},"type":"object","required":["type","geometry"],"title":"GeoJSONGeometry"},"GeoJSONLineString":{"properties":{"type":{"allOf":[{"$ref":"#/components/schemas/GeometryType"}],"description":"GeoJSON geometry type"},"coordinates":{"items":{"$ref":"#/components/schemas/Coordinates"},"type":"array","minItems":2,"title":"Coordinates"}},"type":"object","required":["type","coordinates"],"title":"GeoJSONLineString"},"GeometryFormat":{"enum":["geojson","polyline","polyline6"],"title":"GeometryFormat","description":"An enumeration."},"GeometryType":{"enum":["LineString"],"title":"GeometryType","description":"An enumeration."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Language":{"enum":["cs","de","en","es","fr","pl","ru","sk","el","it","nl","pt","tr","uk"],"title":"Language","description":"An enumeration."},"MatrixResult":{"properties":{"length":{"type":"integer","title":"Route length in meters"},"duration":{"type":"integer","title":"Route duration in seconds"}},"type":"object","required":["length","duration"],"title":"MatrixResult"},"MatrixRoutingResponse":{"properties":{"matrix":{"items":{"items":{"$ref":"#/components/schemas/MatrixResult"},"type":"array"},"type":"array","title":"Matrix","description":"Matrix of routing results"}},"type":"object","required":["matrix"],"title":"MatrixRoutingResponse"},"Point":{"properties":{"longitude":{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Longitude"},"latitude":{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Latitude"}},"type":"object","required":["longitude","latitude"],"title":"Point"},"Polyline":{"type":"string","title":"Polyline","description":"Geometry in Google polyline format"},"Polyline6":{"type":"string","title":"Polyline6","description":"Geometry in Google polyline6 format"},"RoutePart":{"properties":{"length":{"type":"integer","title":"Route length in meters"},"duration":{"type":"integer","title":"Route duration in seconds"}},"type":"object","required":["length","duration"],"title":"RoutePart"},"RoutePoint":{"properties":{"originalPosition":{"items":[{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Longitude"},{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Latitude"}],"type":"array","maxItems":2,"minItems":2,"title":"Original position coordinates"},"mappedPosition":{"items":[{"type":"number","maximum":180.0,"minimum":-180.0,"title":"Longitude"},{"type":"number","maximum":90.0,"minimum":-90.0,"title":"Latitude"}],"type":"array","maxItems":2,"minItems":2,"title":"Routing network mapped position coordinates"},"snapDistance":{"type":"integer","title":"Distance between original and mapped position"},"restricted":{"type":"boolean","title":"Restricted","default":false},"restrictionType":{"$ref":"#/components/schemas/EnclosedTrafficArea"}},"type":"object","required":["originalPosition","mappedPosition","snapDistance"],"title":"RoutePoint"},"RouteType":{"enum":["car_fast","car_fast_traffic","car_short","foot_fast","foot_hiking","bike_road","bike_mountain"],"title":"RouteType","description":"An enumeration."},"RoutingError":{"properties":{"msg":{"type":"string","title":"Error message"},"errorCode":{"type":"integer","title":"Error code"}},"type":"object","required":["msg","errorCode"],"title":"RoutingError"},"RoutingErrorResponse":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/RoutingError"},"type":"array","title":"Error detail"}},"type":"object","required":["detail"],"title":"RoutingErrorResponse"},"RoutingResponse":{"properties":{"length":{"type":"integer","title":"Route length in meters"},"duration":{"type":"integer","title":"Route duration in seconds"},"geometry":{"anyOf":[{"$ref":"#/components/schemas/GeoJSONGeometry"},{"$ref":"#/components/schemas/Polyline"},{"$ref":"#/components/schemas/Polyline6"}],"title":"Geometry","description":"Planned route in the selected format"},"parts":{"items":{"$ref":"#/components/schemas/RoutePart"},"type":"array","title":"Route parts between each waypoint"},"routePoints":{"items":{"$ref":"#/components/schemas/RoutePoint"},"type":"array","title":"Route points data"}},"type":"object","required":["length","duration","geometry"],"title":"RoutingResponse","example":{"length":195,"duration":42,"geometry":{"type":"Feature","geometry":{"type":"LineString","coordinates":[[14.437229,50.100212],[14.43722,50.10008],[14.437139,50.099705],[14.437103,50.099486],[14.437041,50.099452],[14.436951,50.099423],[14.436618,50.099365],[14.435828,50.099221],[14.435594,50.09917]]},"properties":{}},"parts":[{"length":119,"duration":25},{"length":76,"duration":17}],"routePoints":[{"originalPosition":[14.4372475,50.1002117],"mappedPosition":[14.4372292,50.1002125],"snapDistance":1,"restricted":true},{"originalPosition":[14.4366494,50.09931],"mappedPosition":[14.4366183,50.0993654],"snapDistance":6,"restricted":true,"restrictionType":"PEDESTRIAN_ZONE"},{"originalPosition":[14.4355764,50.0991964],"mappedPosition":[14.4355942,50.0991695],"snapDistance":3,"restricted":false}]}},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"headerApiKey":{"type":"apiKey","in":"header","name":"X-Mapy-Api-Key"},"queryApiKey":{"type":"apiKey","in":"query","name":"apikey"}}},"servers":[{"url":"https://api.mapy.com/"},{"url":"https://api.mapy.cz/"}],"tags":[{"name":"routing","description":"Routing operations"}],"security":[{"queryApiKey":[]},{"headerApiKey":[]}]}