GeoDB Global Cities & Countries API
Published by @mdforge
· Verified Publisher
99.99% uptime
~14ms avg
AI Score 94/100
Search 138,000+ world cities & 250 countries by name prefix, population, nearby GPS radius, and city-to-city distance.
Live Interactive Playground
https://api.indieapis.com/v1/geodb-cities/cities
Find cities by namePrefix, countryIds (US,GB,DE), minPopulation, and sort order.
Live JSON Response
Click "Run Live Test" to query live data
{
"ok": true,
"total": 14,
"cities": [
{
"id": 5128581,
"name": "New York City",
"country_code": "US",
"population": 8175133,
"latitude": 40.71427,
"longitude": -74.00597
}
]
}
Overview & Documentation
Lightning-fast global city & country reference data backed by the open GeoNames 138,000+ cities dataset — sub-15ms responses with hard monthly spend caps.
Included endpoints:
/cities— Filter bynamePrefix,countryIds(comma-separated ISO codes),minPopulation,maxPopulation, and sort by population or name./cities/nearby— Haversine radius search around any(lat, lon)coordinate with exactdistance_kmanddistance_miles./cities/distance— Instant great-circle distance between any two world cities./countries— 250 countries with ISO2/ISO3, capital, currencies, languages, calling code, region, and coordinates.
Gateway Headers & Hard Caps
Every response includes X-Quota-Limit, X-Quota-Used, X-Quota-Remaining, and X-Quota-Reset.
When your monthly quota is reached, the gateway returns 429 QUOTA_EXCEEDED so you are never billed surprise overages.
Complete Endpoint Reference (4 Endpoints)
Base URL: https://api.indieapis.com/v1/geodb-cities · Scoped MCP: https://indieapis.com/mcp/geodb-cities
| Method | Path | Parameters | Description |
|---|---|---|---|
| GET | /cities |
namePrefix, countryIds, minPopulation, limit
|
Find cities by namePrefix, countryIds (US,GB,DE), minPopulation, and sort order. |
| GET | /cities/nearby |
lat*, lon*, radiusKm, minPopulation
|
Return cities within radiusKm of a latitude/longitude sorted by closest distance. |
| GET | /cities/distance |
from*, to*
|
Calculate exact great-circle distance in km and miles between any two world cities. |
| GET | /countries |
region, namePrefix
|
Lookup ISO codes, capitals, currencies, languages, calling codes, and regions. |