LatLong
GET/v4/directions.json

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 →

Authentication

Include your API token in the request header:

X-Authorization-Token: your_token_here

Parameters

NameTypeRequiredDescription
originstringRequiredStarting point (lat,lng)
destinationstringRequiredEnd point (lat,lng)
waypointsstringOptionalIntermediate 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"

Response

JSON200 OK
{
  "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" }
    ]
  }
}

Ready to try it?

Test this API interactively in the playground.

Open Playground →