OptionalcomputeAdditionalTravelTimeFor?: ComputeTravelTimeForRequest additional travel time calculations for different traffic scenarios.
When set to 'all', the returned route summary will contain extra fields:
noTrafficTravelTimeInSeconds – Free-flow (no traffic)historicTrafficTravelTimeInSeconds – Historic traffic patternsliveTrafficIncidentsTravelTimeInSeconds – Current live trafficUseful for comparing traffic impact and displaying "X minutes saved by leaving now".
OptionalextendedRouteRepresentations?: ExtendedRouteRepresentation[]Request extended progress information at route polyline points.
Includes cumulative distance and/or time from start to each coordinate. When non-empty, the route features will contain additional property "progress" with an array of objects containing:
pointIndex – Index of the coordinate in the route geometrytravelTimeInSeconds - Cumulative travel time from start to this point (if "travelTime" is requested)distanceInMeters - Cumulative distance from start to this point (if "distance" is requested)Useful for displaying progress during navigation or animating route visualization.
Optionalguidance?: GuidanceParamsRequest turn-by-turn guidance instructions.
When specified, the response includes detailed navigation instructions with maneuvers, road names, and optional phonetics.
Ordered list of locations (waypoints) and/or path points for route calculation.
The route will pass through these locations in the specified order.
Requirements:
Supported formats:
[longitude, latitude]// 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
]
// (not supported) Waypoint objects with radius for circle waypoints
locations: [
[4.9, 52.3],
{
type: 'Feature',
geometry: { type: 'Point', coordinates: [4.7, 52.1] },
properties: { radiusMeters: 5000 }
},
[4.5, 51.9]
]
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.
OptionaluseEntryPoints?: GetPositionEntryPointOptionControls how entry points are used for routing.
Entry points represent specific building entrances or facility access points. Using them improves 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', phonetics: 'IPA' },
maxAlternatives: 2,
costModel: {
routeType: 'fast',
avoid: ['tollRoads', 'motorways']
},
when: {
option: 'departAt',
date: new Date('2025-10-20T08:00:00Z')
}
};
// Electric vehicle route with charging
const evParams: CalculateRouteParams = {
apiKey: 'your-api-key',
locations: [[4.9, 52.3], [8.5, 50.1]],
vehicle: {
engineType: 'electric',
model: {
engine: {
charging: { maxChargeKWH: 85 },
consumption: {
speedsToConsumptionsKWH: [
{ speedKMH: 50, consumptionUnitsPer100KM: 8 },
{ speedKMH: 80, consumptionUnitsPer100KM: 12 },
{ speedKMH: 120, consumptionUnitsPer100KM: 18 }
]
}
}
},
state: { currentChargeInkWh: 50 }
}
};
Parameters for calculating a route between waypoints.
Includes origin, destination, optional intermediate waypoints, and various routing options to customize the calculated route based on vehicle type, traffic, and preferences.