Skip to content
GuidesBlogPlaygroundDashboard

Routing

Calculate a route between two points
RouteResult Routing.Route(RoutingRouteParamsparameters, CancellationTokencancellationToken = default)
POST/api/v1/route
Snap a coordinate to the nearest road
NearestResult Routing.Nearest(RoutingNearestParamsparameters, CancellationTokencancellationToken = default)
GET/api/v1/nearest
Snap a coordinate to the nearest road
NearestResult Routing.NearestPost(RoutingNearestPostParamsparameters, CancellationTokencancellationToken = default)
POST/api/v1/nearest
Calculate an isochrone from a point
RoutingIsochroneResponse Routing.Isochrone(RoutingIsochroneParamsparameters, CancellationTokencancellationToken = default)
GET/api/v1/isochrone
Calculate an isochrone from a point
RoutingIsochronePostResponse Routing.IsochronePost(RoutingIsochronePostParamsparameters, CancellationTokencancellationToken = default)
POST/api/v1/isochrone
Calculate a distance matrix between points
IReadOnlyDictionary<string, JsonElement> Routing.Matrix(RoutingMatrixParamsparameters, CancellationTokencancellationToken = default)
POST/api/v1/matrix
ModelsExpand Collapse
class MatrixRequest:

Request body for distance matrix calculation. Computes travel durations (and optionally distances) between every origin-destination pair. Maximum 2,500 pairs (origins × destinations), each list capped at 50 coordinates.

required IReadOnlyList<Destination> Destinations

Array of destination coordinates (max 50)

required Double Lat

Latitude in decimal degrees (-90 to 90)

maximum90
minimum-90
required Double Lng

Longitude in decimal degrees (-180 to 180)

maximum180
minimum-180
required IReadOnlyList<Origin> Origins

Array of origin coordinates (max 50)

required Double Lat

Latitude in decimal degrees (-90 to 90)

maximum90
minimum-90
required Double Lng

Longitude in decimal degrees (-180 to 180)

maximum180
minimum-180
string Annotations

Comma-separated list of annotations to include: duration (always included), distance. Example: duration,distance.

Double? FallbackSpeed

Fallback speed in km/h for pairs where no route exists. When set, unreachable pairs get estimated values instead of null.

exclusiveMinimum
minimum0
Mode Mode

Travel mode (default: auto)

One of the following:
"auto"Auto
"foot"Foot
"bicycle"Bicycle
class NearestResult:

GeoJSON Point Feature representing the nearest point on the road network to the input coordinate. Used for snapping GPS coordinates to roads.

required GeoJsonGeometry Geometry

GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints.

required Coordinates Coordinates

Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc.

One of the following:
IReadOnlyList<Double>
IReadOnlyList<IReadOnlyList<Double>>
IReadOnlyList<IReadOnlyList<IReadOnlyList<Double>>>
IReadOnlyList<IReadOnlyList<IReadOnlyList<IReadOnlyList<Double>>>>
required Type Type

Geometry type

One of the following:
"Point"Point
"LineString"LineString
"Polygon"Polygon
"MultiPoint"MultiPoint
"MultiLineString"MultiLineString
"MultiPolygon"MultiPolygon
required Properties Properties

Snap result metadata

Double DistanceM

Distance from the input coordinate to the snapped point in meters

Long EdgeID

ID of the road network edge that was snapped to

Double EdgeLengthM

Length of the matched road edge in meters

string? Highway

OSM highway tag value (e.g. residential, primary, motorway)

Long OsmWayID

OSM way ID of the matched road segment

string? Surface

OSM surface tag value (e.g. asphalt, gravel, paved)

required Type Type
class RouteRequest:

Request body for route calculation. Origin and destination are lat/lng coordinate objects. Supports optional waypoints, alternative routes, turn-by-turn steps, and EV routing parameters.

required Destination Destination

Geographic coordinate as a JSON object with lat and lng fields.

required Double Lat

Latitude in decimal degrees (-90 to 90)

maximum90
minimum-90
required Double Lng

Longitude in decimal degrees (-180 to 180)

maximum180
minimum-180
required Origin Origin

Geographic coordinate as a JSON object with lat and lng fields.

required Double Lat

Latitude in decimal degrees (-90 to 90)

maximum90
minimum-90
required Double Lng

Longitude in decimal degrees (-180 to 180)

maximum180
minimum-180
Long Alternatives

Number of alternative routes to return (0-3, default 0). When > 0, response is a FeatureCollection of route Features.

maximum3
minimum0
Boolean Annotations

Include per-edge annotations (speed, duration) on the route (default: false)

DateTimeOffset? DepartAt

Departure time for traffic-aware routing (ISO 8601)

formatdate-time
Ev? Ev

Electric vehicle parameters for EV-aware routing

required Double BatteryCapacityWh

Total battery capacity in watt-hours (required for EV routing)

IReadOnlyList<string>? ConnectorTypes

Acceptable connector types (e.g. ["ccs", "chademo"])

Double InitialChargePct

Starting charge as a fraction 0-1 (default: 0.8)

maximum1
minimum0
Double MinChargePct

Minimum acceptable charge at destination as a fraction 0-1 (default: 0.10)

maximum1
minimum0
Double? MinPowerKw

Minimum charger power in kilowatts

string? Exclude

Comma-separated road types to exclude (e.g. toll,motorway,ferry)

Geometries Geometries

Geometry encoding format. Default: geojson.

One of the following:
"geojson"Geojson
"polyline"Polyline
"polyline6"Polyline6
Mode Mode

Travel mode (default: auto)

One of the following:
"auto"Auto
"foot"Foot
"bicycle"Bicycle
Overview Overview

Level of geometry detail: full (all points), simplified (Douglas-Peucker), false (no geometry). Default: full.

One of the following:
"full"Full
"simplified"Simplified
"false"False
Boolean Steps

Include turn-by-turn navigation steps (default: false)

TrafficModel? TrafficModel

Traffic prediction model (only used when depart_at is set)

One of the following:
"best_guess"BestGuess
"optimistic"Optimistic
"pessimistic"Pessimistic
IReadOnlyList<Waypoint>? Waypoints

Intermediate waypoints to visit in order (maximum 25)

required Double Lat

Latitude in decimal degrees (-90 to 90)

maximum90
minimum-90
required Double Lng

Longitude in decimal degrees (-180 to 180)

maximum180
minimum-180
class RouteResult:

GeoJSON Feature representing a calculated route. The geometry is a LineString or MultiLineString of the route path. When alternatives > 0, the response is a FeatureCollection containing multiple route Features.

required GeoJsonGeometry Geometry

GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints.

required Coordinates Coordinates

Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc.

One of the following:
IReadOnlyList<Double>
IReadOnlyList<IReadOnlyList<Double>>
IReadOnlyList<IReadOnlyList<IReadOnlyList<Double>>>
IReadOnlyList<IReadOnlyList<IReadOnlyList<IReadOnlyList<Double>>>>
required Type Type

Geometry type

One of the following:
"Point"Point
"LineString"LineString
"Polygon"Polygon
"MultiPoint"MultiPoint
"MultiLineString"MultiLineString
"MultiPolygon"MultiPolygon
required Properties Properties

Route metadata

required Double DistanceM

Total route distance in meters

required Double DurationS

Estimated travel duration in seconds

IReadOnlyDictionary<string, JsonElement>? Annotations

Per-edge annotations (present when annotations: true in request)

IReadOnlyList<IReadOnlyList<Double>>? ChargeProfile

Battery charge level at route waypoints as [distance_fraction, charge_pct] pairs (EV routes only)

IReadOnlyList<IReadOnlyDictionary<string, JsonElement>>? ChargingStops

Recommended charging stops along the route (EV routes only)

IReadOnlyList<IReadOnlyDictionary<string, JsonElement>>? Edges

Edge-level route details (present when annotations: true)

Double? EnergyUsedWh

Total energy consumed in watt-hours (EV routes only)

required Type Type