Get the largest cities in any country, or the cities near a location
Address forms, store locators, travel apps and data dashboards keep needing the same reference data: the main cities of a country, what's near a point on the map, and each city's coordinates and time zone.
The World Cities API covers every city with 15,000+ people (32,000+ cities in 245 countries, from GeoNames) with population, coordinates, state or province and IANA time zone, so you don't have to download and clean a dataset yourself.
Make the request
Send your API key in the x-api-key header. Free accounts include 1,000 calls a month.
curl "https://apistack.online/api/data/world-cities-database/v1/search-by-country?country=India&minPopulation=1000000&limit=3" \
-H "x-api-key: $APISTACK_API_KEY"{
"success": true,
"endpoint": "search-by-country",
"country": "India",
"data": {
"cities": [
{
"name": "Delhi",
"country": "India",
"adminName1": "Delhi",
"population": 33807403,
"latitude": 28.7041,
"longitude": 77.1025,
"timezone": "Asia/Kolkata"
},
{
"name": "Mumbai",
"country": "India",
"adminName1": "Maharashtra",
"population": 20961472,
"latitude": 19.076,
"longitude": 72.8777,
"timezone": "Asia/Kolkata"
},
{
"name": "Kolkata",
"country": "India",
"adminName1": "West Bengal",
"population": 15133888,
"latitude": 22.5726,
"longitude": 88.3639,
"timezone": "Asia/Kolkata"
}
],
"pagination": {
"total": 54
}
}
}Response abridged: some fields (timestamps, metadata) omitted.
Cities near a location
/search-by-coordinates?latitude=40.7128&longitude=-74.0060&radius=25 returns the cities within 25 km of New York, nearest first, each with its distance. Handy for "near me" features and for picking the closest office or warehouse.
Search by name
/search-by-name?q=springfield finds every city with that name or alternate name, so users can pick the right one (there are many Springfields). Names in local scripts work too, like 東京 for Tokyo.
Attribution
City data includes GeoNames (geonames.org), licensed CC BY 4.0. If you display it in your product, credit GeoNames.
Give it to your AI agent
The same API is available as an MCP tool. Add APIStack to Claude, Cursor, VS Code or any MCP client:
{
"mcpServers": {
"apistack": {
"url": "https://apistack.online/api/mcp/connect",
"headers": { "x-api-key": "YOUR_API_KEY" }
}
}
}Then ask: “What are the three largest cities in India, and what time zone are they in?” See MCP setup for every client.