curl --request POST \
--url http://localhost:8000/directions/v2:computeRoutes \
--header 'Content-Type: application/json' \
--data '
{
"origin": {
"location": {
"latLng": {
"latitude": 41.878,
"longitude": -87.636
}
}
},
"destination": {
"location": {
"latLng": {
"latitude": 41.705,
"longitude": -87.613
}
}
}
}
'{
"routes": [
{
"routeLabels": [
"DEFAULT_ROUTE"
],
"legs": [
{
"distanceMeters": 123,
"duration": "<string>",
"staticDuration": "<string>",
"polyline": {
"encodedPolyline": "<string>"
},
"startLocation": {
"latLng": {
"latitude": 41.878,
"longitude": -87.636
}
},
"endLocation": {
"latLng": {
"latitude": 41.878,
"longitude": -87.636
}
},
"steps": [
{
"distanceMeters": 123,
"staticDuration": "28s",
"polyline": {
"encodedPolyline": "<string>"
},
"startLocation": {
"latLng": {
"latitude": 41.878,
"longitude": -87.636
}
},
"endLocation": {
"latLng": {
"latitude": 41.878,
"longitude": -87.636
}
},
"navigationInstruction": {
"maneuver": "DEPART",
"instructions": "<string>"
},
"travelMode": "DRIVE",
"enrichment": {
"gradePercent": 2.5,
"curvatureDegreesPerKm": 15.3,
"fuelBurnLiters": 0.42,
"zoneFlags": [
"SCHOOL_ZONE"
],
"speedLimitKmh": 123,
"roadClass": "MOTORWAY",
"degradedFields": [
"<string>"
],
"degradedReason": "<string>"
},
"travelAdvisory": {},
"localizedValues": {},
"transitDetails": {}
}
],
"travelAdvisory": {},
"localizedValues": {},
"stepsOverview": {}
}
],
"distanceMeters": 123,
"duration": "<string>",
"staticDuration": "<string>",
"polyline": {
"encodedPolyline": "<string>"
},
"description": "<string>",
"warnings": [
"<string>"
],
"viewport": {
"low": {
"latitude": 123,
"longitude": 123
},
"high": {
"latitude": 123,
"longitude": 123
}
},
"travelAdvisory": {},
"optimizedIntermediateWaypointIndex": [
123
],
"localizedValues": {},
"routeToken": "<string>",
"polylineDetails": {}
}
],
"fallbackInfo": {},
"geocodingResults": {}
}Compute Routes (Google-compatible)
Drop-in replacement for the Google Routes API. Returns the standard response with additional physics enrichment per step.
curl --request POST \
--url http://localhost:8000/directions/v2:computeRoutes \
--header 'Content-Type: application/json' \
--data '
{
"origin": {
"location": {
"latLng": {
"latitude": 41.878,
"longitude": -87.636
}
}
},
"destination": {
"location": {
"latLng": {
"latitude": 41.705,
"longitude": -87.613
}
}
}
}
'{
"routes": [
{
"routeLabels": [
"DEFAULT_ROUTE"
],
"legs": [
{
"distanceMeters": 123,
"duration": "<string>",
"staticDuration": "<string>",
"polyline": {
"encodedPolyline": "<string>"
},
"startLocation": {
"latLng": {
"latitude": 41.878,
"longitude": -87.636
}
},
"endLocation": {
"latLng": {
"latitude": 41.878,
"longitude": -87.636
}
},
"steps": [
{
"distanceMeters": 123,
"staticDuration": "28s",
"polyline": {
"encodedPolyline": "<string>"
},
"startLocation": {
"latLng": {
"latitude": 41.878,
"longitude": -87.636
}
},
"endLocation": {
"latLng": {
"latitude": 41.878,
"longitude": -87.636
}
},
"navigationInstruction": {
"maneuver": "DEPART",
"instructions": "<string>"
},
"travelMode": "DRIVE",
"enrichment": {
"gradePercent": 2.5,
"curvatureDegreesPerKm": 15.3,
"fuelBurnLiters": 0.42,
"zoneFlags": [
"SCHOOL_ZONE"
],
"speedLimitKmh": 123,
"roadClass": "MOTORWAY",
"degradedFields": [
"<string>"
],
"degradedReason": "<string>"
},
"travelAdvisory": {},
"localizedValues": {},
"transitDetails": {}
}
],
"travelAdvisory": {},
"localizedValues": {},
"stepsOverview": {}
}
],
"distanceMeters": 123,
"duration": "<string>",
"staticDuration": "<string>",
"polyline": {
"encodedPolyline": "<string>"
},
"description": "<string>",
"warnings": [
"<string>"
],
"viewport": {
"low": {
"latitude": 123,
"longitude": 123
},
"high": {
"latitude": 123,
"longitude": 123
}
},
"travelAdvisory": {},
"optimizedIntermediateWaypointIndex": [
123
],
"localizedValues": {},
"routeToken": "<string>",
"polylineDetails": {}
}
],
"fallbackInfo": {},
"geocodingResults": {}
}Headers
Accepted for Google compatibility but ignored. The full response is always returned.
Body
Request body for route computation. Accepts all Google Routes API fields — unsupported fields are silently ignored.
Origin waypoint (required)
Show child attributes
Show child attributes
Destination waypoint (required)
Show child attributes
Show child attributes
Intermediate waypoints (stops or pass-through points)
Show child attributes
Show child attributes
Travel mode. Only DRIVE is supported (truck routing).
Routing preference. Traffic is not currently modeled.
Departure time in ISO 8601 UTC format. Affects school zone detection and time-based routing.
When true and no intermediate waypoints, returns up to 3 alternative routes.
Route modifiers (avoid tolls, highways, ferries)
Show child attributes
Show child attributes
Language for navigation instructions
Vehicle specification for physics enrichment. Defaults to SEMI_TRAILER preset if omitted.
Show child attributes
Show child attributes
Routing profile that adjusts enrichment weights
balanced, fuel_optimal, time_optimal, fatigue_aware Override individual profile weights (e.g. {"fuelWeight": 1.5})
Show child attributes
Show child attributes
Webhook URL for async route completion notifications. Only used by POST /v1/routes.
Response
Successfully computed route(s). The response matches the Google Routes API computeRoutes response shape exactly, with an additional enrichment field on each step.
Response from the Google-compatible computeRoutes endpoint. Returns one or more routes in the same format as the Google Routes API, enriched with segment-level physics data (grade, curvature, fuel burn, zone flags).