POST
/
route
curl --request POST \
  --url https://routing.solvice.io/route \
  --header 'Content-Type: application/json' \
  --data '{
  "coordinates": [
    [
      4.9,
      50.2
    ],
    [
      4.8,
      50.4
    ]
  ]
}'
{
  "routes": [
    {
      "geometry": "{wkqHi~{\\tLb\\uEvH{mA{`@{~Bnr@gSwKkQsp@iDkjBsn@uS}rAtr@ccBt}AuhBxEal@_Ow}AblCqfA~a@mn@{A_Vz~@w|@x{@{PmP{CikA}Sg|@ec@ve@y[xzEyGbLmLmJolA~yCwaB|_B",
      "legs": [
        {
          "steps": [],
          "summary": "",
          "weight": 1976.1,
          "duration": 1976.1,
          "distance": 31561.2
        }
      ],
      "weight_name": "routability",
      "weight": 1976.1,
      "duration": 1976.1,
      "distance": 31561.2
    }
  ],
  "waypoints": [
    {
      "hint": "eX5AgduYjYYsAAAAlAAAAHIAAAAAAAAAxBf6QX7HzELIz51CAAAAACwAAACUAAAAcgAAAAAAAAAVtwAAlMNKAIj__QKgxEoAwP39AgEAXwRPrDVe",
      "distance": 54.20808645369059,
      "name": "Avenue de la Restauration",
      "location": [
        4.899732,
        50.200456
      ]
    },
    {
      "hint": "o_v2gPMxk4KXAAAAQwAAAJsAAADWAwAA4YOXQ0HtBEOh05pDGnn1RJcAAABDAAAAmwAAANYDAAAVtwAAEyhJAG0BAQMAPkkAAAsBAwMAXxRPrDVe",
      "distance": 483.4921257061384,
      "name": "Route des Trois Communes",
      "location": [
        4.794387,
        50.397549
      ]
    }
  ]
}

Request a route for 2 or more coordinates (synchronously) It will return total distance and travel time as well as the geometry to plot it on a map.

Body

application/json

Route Dto

coordinates
array | null
required

The coordinates this request will use, coordinates as [{lon},{lat}] values, in decimal degrees.

bearings
array | null

Limits the search to segments with given bearing in degrees towards true north in clockwise direction. Can be null or an array of [{value},{range}] with integer 0 .. 360,integer 0 .. 180.

radiuses
integer[] | null

Limits the coordinate snapping to streets in the given radius in meters. Can be null double >= 0.

hints
string[] | null

Hints for the coordinate snapping. Array of base64 encoded strings.

generate_hints
boolean | null

Whether or not adds a Hint to the response which can be used in subsequent requests. (optional, default true)

alternatives
integer | null

Search for up to this many alternative routes. Please note that even if alternative routes are requested, a result cannot be guaranteed. (optional, default 0)

steps
boolean | null

Return route steps for each route leg. (optional, default false)

annotations
string[] | null

An array with strings of duration, nodes, distance, weight, datasources, speed (optional)

geometries
string | null

Returned route geometry format (influences overview and per step). Can also be geojson. (optional, default polyline)

overview
string | null

Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all (false). (optional, default simplified)

continue_straight
boolean | null

Forces the route to keep going straight at waypoints and don't do a uturn even if it would be faster. Default value depends on the profile.

approaches
string[] | null

Keep waypoints on curb side. Can be null (unrestricted, default) or curb.

waypoints
integer[] | null

Indices to coordinates to treat as waypoints. If not supplied, all coordinates are waypoints. Must include first and last coordinate index

snapping
string | null
vehicleType
enum<string>

The vehicle type for which the table is requested

Available options:
CAR,
BIKE,
TRUCK,
ELECTRIC_CAR,
ELECTRIC_BIKE
routingEngine
enum<string>

The vehicle type for which the table is requested

Available options:
OSM,
TOMTOM
departureTime
string

The departure time for which you want to calculate the route. This will take into account predictive travel time based on TomTom data.

Example:

"2022-03-10T16:15:50.000Z"

Response

200 - application/json
Get route response

Route response

routes
object[] | null

Represents a route through (potentially multiple) waypoints.

waypoints
object[] | null

List of waypoints to get from A to B.