Statistics of the World

Data API · Works globally · World development indicators

TL;DR

Statistics of the World collects and serves global statistical data — GDP, population, education spending, healthcare metrics, and more — across all countries and regions. The /api/v1/country/all endpoint returns a comprehensive dataset for every country in a single response. Data is aggregated from authoritative sources like the World Bank, IMF, and UN. No API key, no rate limits, clean JSON.

Quick start: https://statisticsoftheworld.com/api/v1/country/all

No API key needed — just make a request!

Get all country statistics: https://statisticsoftheworld.com/api/v1/country/all

How to Use This API

1. All Countries

Returns statistics for every country at once:

https://statisticsoftheworld.com/api/v1/country/all

2. Specific Country

Get data for a single country:

https://statisticsoftheworld.com/api/v1/country/US

3. JavaScript — Compare Two Countries

async function compareCountries(code1, code2) {
  const [r1, r2] = await Promise.all([
    fetch(`https://statisticsoftheworld.com/api/v1/country/${code1}`).then(r => r.json()),
    fetch(`https://statisticsoftheworld.com/api/v1/country/${code2}`).then(r => r.json())
  ]);
  
  console.log(`${r1.country}: GDP ${r1.gdp}, Population ${r1.population}`);
  console.log(`${r2.country}: GDP ${r2.gdp}, Population ${r2.population}`);
}

compareCountries('US', 'DE');

4. Python — Country Rankings

import requests

resp = requests.get('https://statisticsoftheworld.com/api/v1/country/all')
countries = resp.json()

# Sort by GDP descending
sorted_by_gdp = sorted(countries, key=lambda c: c.get('gdp', 0), reverse=True)
for i, c in enumerate(sorted_by_gdp[:10], 1):
    name = c.get('country', c.get('name', '?'))
    gdp = c.get('gdp', 0)
    pop = c.get('population', 0)
    print(f"{i}. {name}: GDP ${gdp:,}, Pop {pop:,}")

Frequently Asked Questions

What indicators are available per country?
GDP (nominal and PPP), population, population density, land area, life expectancy, literacy rate, education spending, healthcare expenditure, unemployment rate, inflation, exports/imports, and more.
What time period does the data cover?
The API primarily provides the most recent available data points. Historical data may be available through specific indicator endpoints.
Do I need an API key?
No. Statistics of the World is completely free with no authentication required.
Where does the data come from?
Data is compiled from the World Bank, International Monetary Fund (IMF), United Nations, CIA World Factbook, and other authoritative international sources.
How are countries identified?
Countries use ISO 3166-1 alpha-2 two-letter codes (US, DE, JP, IN, etc.). The "all" endpoint lists all available countries with their codes.
What format does the API return?
JSON. Each country object contains key-value pairs for each statistical indicator.

API Details

API URL
https://statisticsoftheworld.com/api/v1
Documentation
statisticsoftheworld.com/api-docs
Category
Data
Authentication
Not Required
Geographic Coverage
Global — all countries and territories

What You Can Build