Contact us Login LIVE DEMO FREE TRIAL

get(…)

Get route points via OSRM API.

  • start – (location JSON object) start of route
  • end – (location JSON object) end of route
  • waypoints = [ ${location}, … ] – (optional) list of transitional points.
  • point_limit – (optional. int. min=2) If specified, the returned route will be simplified to contain this number of points (or less).
  • zoom – (optional. int. from 0 to 18). Specifies the zoom level and compresses the route geometry accordingly (see: z parameter description in OSRM API documentation)

Where location described in custom types description section.

return:

{
    "success": true,
    "distance": 2546, // (int) length in meters
    "time": 194,      // (int) duration in seconds
    "list": [ ${location}, ... ], // list of route points
    "key_points": [ ${key_point}, ... ] 
}

key_points is list of points corresponding to start point, waypoints and end point (in that sequence).
Where key_point is JSON object:

{
    "id": 123,        // (int) index in points 'list'
    "lat": 56.827,    // latitude
    "lng": 60.594296  // longitude
}

errors:

  • 215 – External service error
  • 218 – Malformed external service parameters
    {
        "success": false,
        "status": {
            "code": 218,
            "description": "Malformed external service parameters"
        },
        "errors": [
            {
                "status": "NOT_FOUND", // NOT_FOUND or UNKNOWN_ERROR
                "status_code": 207,    // OSRM status code (don't rely on it)
                "message": "Cannot find route between points" // OSRM error message (don't rely on it)
            }
        ]
    }
    

    where status is one of:

    • NOT_FOUND – indicates at least one of the locations specified in the request’s origin, destination, or waypoints could not be geocoded, or OSRM cannot find route.
    • UNKNOWN_ERROR – unexpected OSRM error code

If you have more questions please contact our support team

Contacts

USA: +1 858 815 9045

Mexico: +52 334 1642158

UK: +44 808 1641499

Germany: +49 1573 5988250

Russia: +7 495 317 1622

Log in

Loading...

We use сookies to improve our website, products and related services, analyze site traffic, and serve targeted advertisements. If you continue to use our services, you consent to our use of сookies. Read more