Response format

The response contains an array of rows objects. Each elements object in the array contains the properties of a single route.

https://distancematrix.api.mappable.world/v2/?origins=55.350952,25.249269|55.351206,25.248066&destinations=55.254270,25.225335&mode=transit&apikey=YOUR_API_KEY

In this case, the response will look like this:

Response
{
    "rows": [
        {
            "elements": [
                {
                    "status": "OK",
                    "distance": {
                        "value": 1268
                    },
                    "duration": {
                        "value": 4233
                    }
                }
            ]
        },
        {
            "elements": [
                {
                    "status": "OK",
                    "distance": {
                        "value": 1407
                    },
                    "duration": {
                        "value": 4333
                    }
                }
            ]
        }
    ]
}

Response params

rows

Array of routes between points. Objects in the array are arranged in the order of the elements in the origins parameter.

elements

The element that contains information about the route. Objects in the array are arranged in the order of the elements in the destinations parameter.

duration

The element that contains information about the route's duration.

value
Route's duration in seconds.
status

Route calculation status. Possible values:

  • OK: The route was calculated successfully.
  • FAIL: There was a problem calculating the route. For example, no road can be found next to the specified point.
distance

Element that contains information about the route length.

value
Route length in meters.

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, the API returns a message with the error description in the errors field:

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