Calculate routes

Calculates a route using a generic vehicle/pedestrian mode, e.g. car, truck, pedestrian, etc...

Query Params
string
enum
required

Mode of transport to be used for the calculation of the route.

Note: taxi and bus modes are in Alpha state. They are not yet stable and behaviour may change drastically, or even become unsupported, without warning. taxi and bus modes take into account taxi/bus restricted streets as well as streets reserved for exclusive taxi/bus access. It does not, however, consider exclusive lanes in otherwise shared streets. Also, the streets that are for exclusive access for taxi/bus are used only if either the origin or destination are on them.

Allowed:
string
required

A location defining origin of the trip.

Format

Format: Place[WaypointOptions]

  • Place: {lat},{lng}[PlaceOptions]
  • PlaceOptions: ;option1=value1;option2=value2...
  • WaypointOptions: !option1=value1!option2=value2...

A waypoint consists of:

  • Exactly one place
  • Optional settings for the place
  • Optional settings for the waypoint itself

Supported place options:

  • course: int, degrees clock-wise from north. Indicating desired direction at the place. E.g. 90 indicating east. Often combined with radius and/or minCourseDistance
  • sideOfStreetHint: {lat},{lng}. Indicating the side of the street that should be used. E.g. if the location is to the left of the street, the router will prefer using that side in case the street has dividers. E.g. 52.511496,13.304140;sideOfStreetHint=52.512149,13.304076 indicates that the north side of the street should be preferred. This option is required, if matchSideOfStreet is set to always.
  • matchSideOfStreet: enum [always, onlyIfDivided]. Specifies how the location set by sideOfStreetHint should be handled. Requires sideOfStreetHint to be specified as well.
    • always : Always prefer the given side of street.
    • onlyIfDivided: Only prefer using side of street set by sideOfStreetHint in case the street has dividers. This is the default behavior.
  • nameHint: string. Causes the router to look for the place with the most similar name. This can e.g. include things like: North being used to differentiate between interstates I66 North and I66 South, Downtown Avenue being used to correctly select a residental street.
  • radius: int, meters. Asks the router to consider all places within the given radius as potential candidates for route calculation. This can be either because it is not important which place is used, or because it is unknown. Radius more than 200meter are not supported.
  • minCourseDistance: int, meters. Asks the routing service to try find a route that avoids actions for the indicated distance. E.g. if the origin is determined by a moving vehicle, the user might not have time to react to early actions.

Notes:

  • stopDuration option is not supported for origin, contrary to destination and via waypoints.
  • passThrough: option is not supported for 'origin'.
  • Non-structural reserved characters in options' values need to be properly percent-encoded. Please refer to the developers' guide for more details.
string
required

A location defining destination of the trip.

Format

Format: Place[WaypointOptions]

  • Place: {lat},{lng}[PlaceOptions]
  • PlaceOptions: ;option1=value1;option2=value2...
  • WaypointOptions: !option1=value1!option2=value2...

A waypoint consists of:

  • Exactly one place
  • Optional settings for the place
  • Optional settings for the waypoint itself

Supported place options:

  • course: int, degrees clock-wise from north. Indicating desired direction at the place. E.g. 90 indicating east. Often combined with radius and/or minCourseDistance
  • sideOfStreetHint: {lat},{lng}. Indicating the side of the street that should be used. E.g. if the location is to the left of the street, the router will prefer using that side in case the street has dividers. E.g. 52.511496,13.304140;sideOfStreetHint=52.512149,13.304076 indicates that the north side of the street should be preferred. This option is required, if matchSideOfStreet is set to always.
  • matchSideOfStreet: enum [always, onlyIfDivided]. Specifies how the location set by sideOfStreetHint should be handled. Requires sideOfStreetHint to be specified as well.
    • always : Always prefer the given side of street.
    • onlyIfDivided: Only prefer using side of street set by sideOfStreetHint in case the street has dividers. This is the default behavior.
  • nameHint: string. Causes the router to look for the place with the most similar name. This can e.g. include things like: North being used to differentiate between interstates I66 North and I66 South, Downtown Avenue being used to correctly select a residental street.
  • radius: int, meters. Asks the router to consider all places within the given radius as potential candidates for route calculation. This can be either because it is not important which place is used, or because it is unknown. Radius more than 200meter are not supported.
  • minCourseDistance: int, meters. Asks the routing service to try find a route that avoids actions for the indicated distance. E.g. if the origin is determined by a moving vehicle, the user might not have time to react to early actions.

Supported waypoint options:

  • stopDuration: desired duration for the stop, in seconds. The section arriving at this via waypoint will have a wait post action reflecting the stopping time. The consecutive section will start at the arrival time of the former section + stop duration.
  • passThrough: option is not supported for 'destination'.

Notes:

  • Non-structural reserved characters in options' values need to be properly percent-encoded. Please refer to the developers' guide for more details.
via
array of strings

A location defining a via waypoint.

A via waypoint is a location between origin and destination. The route will do a stop at the via waypoint.

Multiple waypoints can also be specified using multiple via parameters like via=...&via=..., in which case the route will traverse these waypoints sequentially in the order specified in the request.

Format

Format: Place[WaypointOptions]

  • Place: {lat},{lng}[PlaceOptions]
  • PlaceOptions: ;option1=value1;option2=value2...
  • WaypointOptions: !option1=value1!option2=value2...

A waypoint consists of:

  • Exactly one place
  • Optional settings for the place
  • Optional settings for the waypoint itself

Supported place options:

  • course: int, degrees clock-wise from north. Indicating desired direction at the place. E.g. 90 indicating east. Often combined with radius and/or minCourseDistance
  • sideOfStreetHint: {lat},{lng}. Indicating the side of the street that should be used. E.g. if the location is to the left of the street, the router will prefer using that side in case the street has dividers. E.g. 52.511496,13.304140;sideOfStreetHint=52.512149,13.304076 indicates that the north side of the street should be preferred. This option is required, if matchSideOfStreet is set to always.
  • matchSideOfStreet: enum [always, onlyIfDivided]. Specifies how the location set by sideOfStreetHint should be handled. Requires sideOfStreetHint to be specified as well.
    • always : Always prefer the given side of street.
    • onlyIfDivided: Only prefer using side of street set by sideOfStreetHint in case the street has dividers. This is the default behavior.
  • nameHint: string. Causes the router to look for the place with the most similar name. This can e.g. include things like: North being used to differentiate between interstates I66 North and I66 South, Downtown Avenue being used to correctly select a residental street.
  • radius: int, meters. Asks the router to consider all places within the given radius as potential candidates for route calculation. This can be either because it is not important which place is used, or because it is unknown. Radius more than 200meter are not supported.
  • minCourseDistance: int, meters. Asks the routing service to try find a route that avoids actions for the indicated distance. E.g. if the origin is determined by a moving vehicle, the user might not have time to react to early actions.

Supported waypoint options:

  • stopDuration: desired duration for the stop, in seconds.

  • passThrough: boolean. Asks the router to avoid the following during route calculation:

    • Introducing a stop at the waypoint.
    • Splitting the route into sections.
    • Changing the direction of travel.

    Following scenarios are not supported for passThrough parameter:

    • Setting both stopDuration to a value greater than 0 and passThrough=true.
    • Setting passThrough=true for origin or destination of a route. The default value is false.

Notes:

  • Non-structural reserved characters in options' values need to be properly percent-encoded. Please refer to the developers' guide for more details.
via
string

Specifies the time of departure as defined by either date-time or full-date T partial-time in RFC 3339, section 5.6 (for example, 2019-06-24T01:23:45).

The requested time is converted to local time at origin. When the optional timezone offset is not specified, time is assumed to be local. The special value any can be used to indicate that time should not be taken into account during routing. If neither departureTime or arrivalTime are specified, current time at departure place will be used. All time values in the response are returned in the timezone of each location.

string
enum
Defaults to fast

Specifies which optimization is applied during route calculation.

  • fast: Route calculation from start to destination optimized by travel time. In many cases, the route returned by the fast mode may not be the route with the fastest possible travel time. For example, the routing service may favor a route that remains on a highway, even if a faster travel time can be achieved by taking a detour or shortcut through an inconvenient side road.
  • short: Route calculation from start to destination disregarding any speed information. In this mode, the distance of the route is minimized, while keeping the route sensible. This includes, for example, penalizing turns. Because of that, the resulting route will not necessarily be the one with minimal distance.

Notes:

  • The following Transport modes only support fast routingMode
    • bicycle
    • bus
    • pedestrian
    • scooter
    • taxi
Allowed:
integer
0 to 6
Defaults to 0

Number of alternative routes to return aside from the optimal route.

avoid
object

Avoid routes that violate certain features of road network or that go through user-specified geographical bounding boxes.

Note that if the origin, destination, or any via is in an avoided area or on an avoided feature, a route is produced that violates the avoid restriction. In such a case, the route is trying to minimize the violation of the avoid restrictions and can therefore include large deviations from a route that is calculated without these avoid restrictions.

It is also possible that the produced route violates the avoid restriction in between waypoints, if no other route is possible or too hard to find. One such example is requesting a route to an island that is only reachable with ferries while specifying avoid[features]=ferry.

Further, avoid can cause the route calculation to fail, if no route is possible or too hard to find.

Specify properties using array notation like avoid[features]=controlledAccessHighway,tunnel.

exclude
object

Defines properties which will be strictly excluded from route calculation.

string
enum

Units of measurement used in guidance instructions. The default is metric.

Allowed:
string
Defaults to en-US

Specifies the preferred language of the response. The value should comply with the IETF BCP 47.

return
array of objects

Defines which attributes are included in the response as part of data representation of a Route or Section.

  • polyline - Polyline for the route in Flexible Polyline Encoding. Either a 2D polyline (without elevation specified), or a 3D polyline with the 3rd dimension type Elevation (with elevation specified).
  • actions - Actions (such as maneuvers or tasks) that must be taken to complete the section.
  • instructions - Include instructions in returned actions. Instructions are localized to the requested language.
  • summary - Include summary for the section.
  • travelSummary - Include summary for the travel portion of the section.
  • turnByTurnActions - Include all information necessary to support turn by turn guidance to complete the section.
  • mlDuration - Use a region-specific machine learning model to calculate route duration. Disclaimer: This parameter is currently in beta release, and is therefore subject to breaking changes.
  • elevation - Include elevation information in coordinate and geometry types. See e.g. polyline or location.
  • routeHandle - Encode calculated route and return a handle which can be used with routes/{routeHandle} to decode the route at a later point in time.
  • passthrough - Include information on passthrough via waypoints in the section.
  • incidents - Include a list of all incidents applicable to each section. Incidents are localized to the requested language. This requires incidents to be specified as part of the return parameter.
  • routingZones - Include information about routing zones each section goes through.

Following restrictions apply when specifying return parameter:

  • If actions is requested, then polyline must also be requested as well.
  • If instructions is requested, then actions must also be requested as well.
  • If turnByTurnActions is requested, then polyline must also be requested as well.
  • If at least one attribute is requested within the spans parameter, then polyline must be request as well
spans
array of objects

Defines which attributes are included in the response spans. For example, attributes,length will enable the fields attributes and length in the route response.

This parameter also requires that the polyline option is set within the return parameter.

truck
object

Truck specific parameters.

  • shippedHazardousGoods: Comma-separated list of shipped hazardous goods in the vehicle. Possible values are:
    • explosive: Explosive material
    • gas: Gas
    • flammable: Flammable material
    • combustible: Combustible material
    • organic: Organic material
    • poison: Poison
    • radioactive: Radioactive material
    • corrosive: Corrosive material
    • poisonousInhalation: Materials that are poisonous upon inhalation
    • harmfulToWater: Materials that are harmful to water
    • other: Other types of hazardous materials
  • grossWeight: Vehicle weight including trailers and shipped goods, in kilograms.
  • weightPerAxle: Vehicle weight per axle, in kilograms.
  • height: Vehicle height, in centimeters.
  • width: Vehicle width, in centimeters.
  • length: Vehicle length, in centimeters.
  • tunnelCategory: Specifies the tunnel category used to restrict transport of specific goods. Possible values:
    • B
    • C
    • D
    • E
  • axleCount: Defines total number of axles in the vehicle.
  • type: Specifies the type of truck
    • straight: a truck on a single frame with a permanently attached cargo area
    • tractor: a towing vehicle that can pull one or more semi-trailers (aka semi-truck)
  • trailerCount: Number of trailers attached to the vehicle.
ev
object

Disclaimer: This parameter is currently in beta release, and is therefore subject to breaking changes.

EV parameters to be used for calculating consumption and for calculating EV routes with automatically added charging stations.

The following attributes are required for calculating consumption:

  • freeFlowSpeedTable
  • ascent
  • descent

The following attributes are additionally required in order to calculate reachable routes:

  • initialCharge
  • maxCharge
  • connectorTypes
  • chargingCurve
  • maxChargeAfterChargingStation
  • makeReachable set to true

All remaining attributes are optional.

vehicle
object

Disclaimer: these parameters are work in progress and functionality is not complete

Additional generic details about the vehicle for which the route is calculated.

Currently, hovOccupancy and speedCap are defined, with limited functionality

number
0.5 to 2
Defaults to 1

Disclaimer: This parameter is currently in beta release, and is therefore subject to breaking changes. The parameter could be extracted to a separate API if speed capping for cars/trucks is introduced Walking speed in meters per second. Influences the duration of walking segments along the route.

scooter
object

Scooter specific parameters.

  • allowHighway: Specifies whether scooter is allowed on highway or not. This parameter is optional. If not provided, then by default scooter is not allowed to use highway. There is a similar parameter avoid[features]=controlledAccessHighway to disallow highway usage. avoid[features] takes precedence so if this parameter is also used then scooters are not allowed to use highways even if allowHighway is used with value as true. Possible values:
    • true: scooter is allowed to use highway.
    • false: scooter is not allowed to use highway.
traffic
object

Traffic specific parameters.

Headers
string

User-provided token that can be used to trace a request or a group of requests sent to the service.

Responses

Language
Credentials
Header
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json