The Nearest Cities API returns a list of up to 10 cities that are geographically closest to a specified city. This can be useful in applications related to travel, logistics, planning, or location-based services.
Authorization: X-Authorization-Token
(Get your token HERE)/v4/nearest-cities
https://apihub.latlong.ai/v4/nearest-cities
Parameter | Type | Required | Description |
---|---|---|---|
city | String | Yes | The name of the city to search from |
curl --location ‘https://apihub.latlong.ai/v4/nearest-cities.json?address=main%20bazzar%2Cooty%2Ctamilnadu&limit=10'
{
"code": 1001,
"status": "success",
"data": {
"address": "main bazzar,ooty,tamilnadu",
"nearestcity": [
{
"name": "Udhagamandalam",
"adminstrative_type": "Municipality"
},
{
"name": "Kethi",
"adminstrative_type": "Town Panchayat"
},
{
"name": "Adikaratti",
"adminstrative_type": "Town Panchayat"
},
{
"name": "Wellington",
"adminstrative_type": "Municipal Corporation"
},
{
"name": "Sholur",
"adminstrative_type": "Town Panchayat"
},
{
"name": "Coonoor",
"adminstrative_type": "Municipality"
},
{
"name": "Bikketti",
"adminstrative_type": "Town Panchayat"
},
{
"name": "Huligal",
"adminstrative_type": "Town Panchayat"
},
{
"name": "Kilkunda",
"adminstrative_type": "Town Panchayat"
},
{
"name": "Naduvattam",
"adminstrative_type": "Town Panchayat"
}
]
}
}
Returns up to 10 nearest cities for a given input city
Based on geographical distance
️ Fast and reliable response for dynamic UI or mobile apps
Status Code | Message | Description |
---|---|---|
400 | Missing required parameters | When query is not provided |
401 | Unauthorized | API key missing or invalid |
404 | City not found | The input city was not found in the database |
500 | Internal Server Error | Something went wrong on our side |