Driving Directions API
Get turn-by-turn driving directions between two or more points. Returns route geometry, distance, and estimated travel time.
Try in Playground →Endpoint
GET
/v4/directions.jsonAuthentication
Include your token in the request header:
X-Authorization-Token: your_token
Parameters
| Name | Type | Description |
|---|---|---|
| origin | string | Starting point (lat,lng) |
| destination | string | End point (lat,lng) |
| waypoints | string | Intermediate stops (lat,lng|lat,lng) |
Code Examples
curl "https://apihub.latlong.ai/v4/directions.json?origin=VALUE&destination=VALUE" \ -H "X-Authorization-Token: YOUR_TOKEN"
Example Response
JSON
{
"status": "success",
"code": 1001,
"data": {
"distance": "346.2 km",
"duration": "5h 12m",
"geometry": "encoded_polyline_string",
"steps": [
{ "instruction": "Head north on NH44", "distance": "120 km" },
{ "instruction": "Take exit toward Chennai", "distance": "226 km" }
]
}
}
