Response format

The API response contains the route divided into segments. Each segment consists of several steps displayed as polylines. Information about the road quality and estimated time of travel is provided for each segment.

https://router.api.mappable.world/v2/?waypoints=55.280222457968712,25.234369457896325|55.401544758961258,25.234369457896325&apikey=YOUR_API_KEY

In this case, the response will look like this:

Response
{
  "traffic_type": "realtime",
  "route": {
    "legs": [
      {
        "status": "OK",
        "steps": [
          {
            "duration": 11.52513027,
            "length": 44.85900116,
            "polyline": {
              "points": [
                [25.229762, 55.289311],
                ...
                [24.994437, 55.130251]
              ]
            },
            "mode": "driving",
            "waiting_duration": 0
          },
          {
            "duration": 206.4788513,
            "length": 1116.158936,
            "polyline": {
              "points": [
                [25.229762, 55.289311],
                ...
                [24.994437, 55.130251]
              ]
            },
            "mode": "driving",
            "waiting_duration": 0
          },
          {
            "duration": 1143.630005,
            "length": 6356.562988,
            "polyline": {
              "points": [
                [25.229762, 55.289311],
                ...
                [24.994437, 55.130251]
              ]
            },
            "mode": "driving",
            "waiting_duration": 0
          },
          {
            "duration": 239.3830109,
            "length": 524.8220825,
            "polyline": {
              "points": [
                [25.229762, 55.289311],
                ...
                [24.994437, 55.130251]
              ]
            },
            "mode": "driving",
            "waiting_duration": 0
          }
        ]
      }
    ],
    "flags": {
      "hasTolls": true,
      "hasNonTransactionalTolls": false
    }
  }
}
https://router.api.mappable.world/v2/?waypoints={{waypoints-walk}}&mode=walking&apikey=YOUR_API_KEY

In this case, the response will look like this:

Response
{
  "traffic_type": "forecast",
  "route": {
    "legs": [
      {
        "status": "OK",
        "steps": [
          {
            "length": 124,
            "duration": 89,
            "mode": "walking",
            "waiting_duration": 0,
            "polyline": {
              "points": [
                [55.760097,37.617987],
                [55.760089,37.61794],
                [55.7597,37.618147],
                [55.759679,37.618217],
                [55.759668,37.618241],
                [55.75966,37.61825],
                [55.759652,37.618256],
                [55.759544,37.618314],
                [55.759638,37.618861],
                [55.759478,37.618951],
                [55.759479,37.618956]
              ]
            },
            "levels": {
              "level": [{"count": 10}]
            },
            "constructions": {
              "construction": [
                {
                  "count": 1,
                  "construction_mask": {"binding": true}
                },
                {
                  "count": 8,
                  "construction_mask": {}
                },
                {
                  "count": 1,
                  "construction_mask": {"binding": true}
                }
              ]
            }
          }
        ]
      }
    ]
  }
}

Response params

traffic_type

Type of information about traffic used when building the route. Possible values:

  • realtime: Uses information about traffic at the time of the request.
  • forecast: Uses the traffic forecast for the next hour.
  • disabled: Does not use any traffic information.
route

Information about the built route.

legs

Route segments between the points specified in the waypoints parameter.

status

Route building status. Possible values: OK, FAIL

steps

Steps to complete the route segment.

length

Step length in meters.

duration

Time required to complete the step in seconds.

waiting_duration

Information about the waiting time is no longer supported and will soon be removed from the API response. Waiting time without moving at a route segment. For example, the delay time required to wait for a drawbridge to be closed.

mode

Routing mode. Possible values:

  • driving: Passenger car route. Used by default.
  • truck: Truck route.
  • walking: Walking route.
  • transit: Public transit route.
  • bicycle: Bicycle route.
  • scooter: Electric scooter route.
polyline

Polyline making up a route.

points
Points that make up a line. Specified in decimal degrees (WGS84 standard). Each point is defined as a coordinate pair in the format: <longitude,latitude>
constructions

For walking and transit modes.

construction

Array of construction information.

count
Number of points on the polyline related to this construction.
construction_mask
Object with descriptions, like {"stairs_up": true, "indoor": true}, {"crosswalk": true}.
levels

For walking and transit modes. Information about floor levels for the route.

level

Array of floor levels.

count

Number of points on the polyline related to this floor level.

level_info

Information about the floor level. Not present if the route is outside buildings.

level_id
Floor level identifier.
level_name
Floor level name.
connector
Indicates a connecting element (building entrance, stairs, escalator, elevator, etc.).
flags

Additional information about the built route.

hasTolls
Indicates if the route includes toll roads.
hasNonTransactionalTolls
Indicates if the route includes toll roads that are conditionally toll-free.

Error messages

Code Description
400 One or more required parameters are missing in the request.
401 The request doesn't contain the apikey parameter or an invalid key was specified.
429 Too many requests.
500 or 504 System server error. Repeat the request later.

If an error occurs while processing a request, API returns a message with the error description in the errors field:

{"errors": ["0: 0: parameter 'waypoints' is missing"]}
{"errors": ["Key not found"]}
{"errors": ["parameter 'apikey' is missing"]}
{"errors": ["Counter total limit exceeded. Limit: XXX, current value: YYY"]}
Previous