Nearest Cities API

Find cities closest to a given coordinate. Useful for location-based recommendations and regional content delivery.

Try in Playground →

Endpoint

GET/v4/nearest-cities.json

Authentication

Include your token in the request header:

X-Authorization-Token: your_token

Parameters

NameTypeDescription
latitudenumberLatitude of the reference point
longitudenumberLongitude of the reference point
limitnumberNumber of cities to return (default: 10)

Code Examples

curl "https://apihub.latlong.ai/v4/nearest-cities.json?latitude=VALUE&longitude=VALUE" \
  -H "X-Authorization-Token: YOUR_TOKEN"

Example Response

JSON
{
  "status": "success",
  "code": 1001,
  "data": [
    { "name": "Bangalore", "distance": "0.5 km", "state": "Karnataka" },
    { "name": "Whitefield", "distance": "18.2 km", "state": "Karnataka" },
    { "name": "Electronic City", "distance": "20.1 km", "state": "Karnataka" }
  ]
}