Countries & Cities REST API
Geographic and demographic data for 261 countries and millions of cities. One API, four languages.
The Bamwor API provides programmatic access to geographic and demographic data from 261 countries and millions of cities worldwide. Integrate country statistics, population data, GDP figures, city coordinates, and geospatial search into your applications. All data is sourced from the CIA World Factbook, GeoNames, and other authoritative sources. Data sources Β· Methodology
curl -H "X-API-Key: bw_live_your_key_here" \
https://bamwor.com/api/v1/countries/argentina
{
"data": {
"iso_code": "AR",
"names": { "en": "Argentina", "es": "Argentina", ... },
"population": 46621847,
"area_sq_km": 2780400,
"stats": { "gdp_nominal": { "value": 641102, ... }, ... }
}
}Why Bamwor API?
Unlike basic country data APIs, Bamwor provides the most comprehensive geographic and demographic dataset available through a single country REST API. Whether you need a free country API for basic stats, a city data API for 13.4 million cities, or detailed country profiles with narrative content β Bamwor covers it all:
- β261 countries and territories β more than any other free country API
- β13.4 million cities β with coordinates, population, timezone, and elevation
- β25+ statistics per country β including GDP, population, area, HDI, life expectancy, literacy rate, and 9 proprietary indices
- β9 proprietary analytical indices β (IBEE, IBFM, IBDI, IBED, IBSA, IBEU, IBCP, IBDA, IBCX) β exclusive to Bamwor
- βCountry comparisons β compare any two countries side by side across all metrics
- βRankings β countries ranked by any metric
- βMultilingual β full support for English, Spanish, Italian, and Portuguese
- βMCP Server β connect AI agents (Claude, Cursor, Windsurf) directly to world data
- βCountry profiles with narrative content β government, economy, demographics, military, infrastructure for every country. Premium plan. Try free with Colombia, Italy, Australia
Bamwor is the natural evolution of traditional country data sources like the CIA World Factbook and RestCountries. One API for everything.
See how Bamwor compares: Bamwor vs RestCountries | Bamwor vs GeoNames
Get Started in 30 Seconds
1. Get your free API key at bamwor.com/developers/quickstart. 2. Make your first request:
// Get country data
const response = await fetch(
'https://bamwor.com/api/v1/countries/japan',
{ headers: { 'X-API-Key': 'your_api_key' } }
);
const japan = await response.json();
console.log(japan.name, japan.population);import requests
headers = {"X-API-Key": "your_api_key"}
response = requests.get(
"https://bamwor.com/api/v1/countries/japan",
headers=headers
)
japan = response.json()
print(japan["name"], japan["population"])What you can build
Country Profiles
Population, GDP, area, HDI, life expectancy, and 20+ statistics for every country and territory.
City Database
Millions of cities with coordinates, population, elevation, timezone, and nearby places via PostGIS.
Rankings
Countries ranked by population, area, GDP, density, HDI, and more. Filter by region.
Search
Full-text search across countries and cities in 4 languages with population-based relevance.
Multilingual
All names and slugs in English, Spanish, Portuguese, and Italian. Built-in i18n.
Nearby Places
Find cities within a radius using PostGIS geospatial queries. Distance in kilometers.
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/countries | List all countries (paginated) |
| GET | /api/v1/countries/:slug | Country detail with all stats |
| GET | /api/v1/countries/:slug/cities | Cities in a country (paginated) |
| GET | /api/v1/cities/:id | City detail by ID |
| GET | /api/v1/cities/:id/nearby | Nearby cities (radius search) |
| GET | /api/v1/search?q=... | Search countries and cities |
| GET | /api/v1/rankings | Available ranking metrics |
| GET | /api/v1/rankings/:slug | Country ranking by metric |