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.json

Authentication

Include your token in the request header:

X-Authorization-Token: your_token

Parameters

NameTypeDescription
originstringStarting point (lat,lng)
destinationstringEnd point (lat,lng)
waypointsstringIntermediate 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" }
    ]
  }
}