OptionalarrivalSide?: ArrivalSideWhich side of the road the route should arrive on.
OptionalcomputeTravelTimeFor?: ComputeTravelTimeForTravel time calculations for different traffic scenarios.
When set to 'all', the returned route summary contains extra fields:
noTrafficTravelTimeInSeconds – Free-flow (no traffic)historicTrafficTravelTimeInSeconds – Historic traffic patternsliveTrafficIncidentsTravelTimeInSeconds – Current live trafficUse them to compare traffic impact and display "X minutes saved by leaving now".
OptionalextendedRouteRepresentations?: ExtendedRouteRepresentation[]Extended progress information at route polyline points.
When non-empty, the route features contain an extra "progress" property, an array of objects containing:
pointIndex – Index of the coordinate in the route geometrytravelTimeInSeconds - Cumulative travel time from start to this pointdistanceInMeters - Cumulative distance from start to this pointUse it to display progress during navigation or to animate route visualization.
Progress points are all-or-nothing, as ExtendedRouteRepresentation explains: pass an empty array to opt out.
Optionalguidance?: GuidanceParamsTurn-by-turn guidance instructions to request.
When specified, the response includes detailed instructions with maneuvers and road names.
Ordered list of locations (waypoints) and/or path points for route calculation.
The route passes through these locations in the specified order.
It needs at least 2 waypoints (origin and destination), or 1 path with 2+ points.
Supported formats:
[longitude, latitude]The route ends a leg at every location in this list. There is no circle (soft) waypoint that the route merely passes, because the routing API takes a plain point for each one. A path pins the geometry the route must follow, but its endpoints go out as waypoints as well, so it shapes the route without shortening the list of legs.
// Coordinate arrays
locations: [[4.9, 52.3], [4.5, 51.9]]
// With intermediate stop
locations: [[4.9, 52.3], [4.7, 52.1], [4.5, 51.9]]
// Path array for route reconstruction
locations: [
[4.9, 52.3], // Origin waypoint
[
[4.85, 52.25], [4.80, 52.20], [4.75, 52.15] // Path points between waypoints
],
[4.5, 51.9] // Destination waypoint
]
OptionalmaxAlternatives?: MaxNumberOfAlternativesMaximum number of alternative routes to calculate.
Alternative routes provide different travel options between the same origin and destination. Each alternative is optimized differently (e.g., avoiding highways, minimizing tolls).
OptionalsectionTypes?: InputSectionTypesRoute section types to include in the response.
Sections help you display route characteristics like tolls, ferries, or traffic.
Leg sections are always included regardless of this parameter, and so are distinct sections
when two or more routes come back. A section type is only present in the response if the
route actually traverses it. The lanes section is returned only when
guidance is also requested, and, when a list is given, only if it
includes lanes.
OptionaluseEntryPoints?: GetPositionEntryPointOptionHow entry points are used for routing.
Entry points represent specific building entrances or facility access points. They improve routing accuracy by directing to the correct entrance.
// Basic route from A to B
const params: CalculateRouteParams = {
apiKey: 'your-api-key',
locations: [
[4.9041, 52.3676], // Amsterdam
[4.4777, 51.9244] // Rotterdam
]
};
// Route with guidance and alternatives
const advancedParams: CalculateRouteParams = {
apiKey: 'your-api-key',
locations: [[4.9041, 52.3676], [4.4777, 51.9244]],
guidance: { type: 'coded' },
maxAlternatives: 2,
costModel: {
routeType: 'fast',
avoid: ['tollRoads', 'motorways']
},
when: {
option: 'departAt',
date: new Date('2025-10-20T08:00:00+02:00')
}
};
// Route for a speed-limited truck
const truckParams: CalculateRouteParams = {
apiKey: 'your-api-key',
locations: [[4.9, 52.3], [8.5, 50.1]],
vehicle: {
model: { dimensions: { weightKG: 40000 } },
restrictions: { maxSpeedKMH: 80 }
}
};
Parameters for calculating a route between waypoints.
They include the origin, destination, optional intermediate waypoints and routing options that customize the calculated route by vehicle type, traffic and preferences.