API Documentation

Free REST API for global statistics. JSON responses. No authentication required for basic access.

Base URL: https://statisticsoftheworld.com
Building a product? Free tier is 1,000 req/day per IP. Pro is 50,000/day with a commercial-use license — same data, no scrape pressure, no surprise 429s.

Rate Limits & Pricing

TierRate LimitPriceAuth
Anonymous1,000 req/dayFreeNone (IP-based)
Developer1,000 req/dayFreeX-API-Key
Pro50,000 req/day$49/moX-API-Key
EnterpriseUnlimitedCustomX-API-Key

Rate limit headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-RateLimit-Tier

Get API Key →

Quick start

Python
import requests

r = requests.get(
    "https://statisticsoftheworld.com/api/v2/history",
    params={"indicator": "IMF.NGDPD", "country": "USA"},
    headers={"X-API-Key": "sotw_YOUR_KEY"},  # optional under 1K/day
)
data = r.json()
print(data["data"][-1])  # latest year
JavaScript
const params = new URLSearchParams({ indicator: "IMF.NGDPD", country: "USA" });
const res = await fetch(
  `https://statisticsoftheworld.com/api/v2/history?${params}`,
  { headers: { "X-API-Key": "sotw_YOUR_KEY" } } // optional under 1K/day
);
const data = await res.json();
console.log(data.data.at(-1)); // latest year

Endpoints

GET/api/v1/countries

List all 218 countries with metadata.

Example curl
curl https://statisticsoftheworld.com/api/v1/countries
Response
{"count":218,"data":[{"id":"USA","name":"United States","region":"North America",...}]}
GET/api/v1/countries/:id

Get a single country with all latest indicator values.

Example curl
curl https://statisticsoftheworld.com/api/v1/countries/USA
Response
{"country":{"id":"CAN","name":"Canada",...},"indicators":[{"id":"IMF.NGDPD","value":2420000000000,...}]}
GET/api/v1/indicators

List all 443 indicators with categories and metadata.

Example curl
curl https://statisticsoftheworld.com/api/v1/indicators
Response
{"count":443,"categories":[...],"data":[{"id":"SP.POP.TOTL","label":"Population",...}]}
GET/api/v1/indicators/:id

Get a single indicator ranked across all countries.

Example curl
curl https://statisticsoftheworld.com/api/v1/indicators/USA
Response
{"indicator":{...},"count":192,"data":[{"rank":1,"countryId":"USA","value":31820000000000},...]}
GET/api/v1/history/:indicator/:country

Get 20+ years of historical data for an indicator-country pair.

Example curl
curl https://statisticsoftheworld.com/api/v1/history/SP.POP.TOTL/CAN
Response
{"indicator":{...},"country":"CAN","data":[{"year":2000,"value":744631000000},{"year":2001,...}]}
GET/api/v1/rankings/:indicator

Get ranked list of countries for an indicator. Supports ?limit=N parameter.

Example curl
curl https://statisticsoftheworld.com/api/v1/rankings/SP.POP.TOTL
Response
{"indicator":{...},"count":192,"data":[{"rank":1,"countryId":"CHN","country":"China","value":1425893000},...]}

Data Sources

IMF World Economic Outlook
World Bank WDI
FRED (Federal Reserve)
Yahoo Finance
European Central Bank
Alpha Vantage
ExchangeRate-API