LatLong
GET/v4/nearest-cities.json

Nearest Cities API

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

Try in Playground →

Authentication

Include your API token in the request header:

X-Authorization-Token: your_token_here

Parameters

NameTypeRequiredDescription
latitudenumberRequiredLatitude of the reference point
longitudenumberRequiredLongitude of the reference point
limitnumberOptionalNumber 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"

Response

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

Ready to try it?

Test this API interactively in the playground.

Open Playground →