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
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:

JavaScript
// 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);
Python
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

MethodEndpointDescription
GET/api/v1/countriesList all countries (paginated)
GET/api/v1/countries/:slugCountry detail with all stats
GET/api/v1/countries/:slug/citiesCities in a country (paginated)
GET/api/v1/cities/:idCity detail by ID
GET/api/v1/cities/:id/nearbyNearby cities (radius search)
GET/api/v1/search?q=...Search countries and cities
GET/api/v1/rankingsAvailable ranking metrics
GET/api/v1/rankings/:slugCountry ranking by metric