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 requests/day per IP across the public catalog. API Pro raises that limit to 50,000/day without removing sources.
Catalog policy: API and MCP reads retain the same 334-indicator public catalog when a key is upgraded. Each response carries source-specific attribution and reuse metadata. Bulk files are a separate redistribution surface: the Data Pro bundle contains 277 reviewed World Bank indicators, and high-frequency bulk exports include only series cleared for redistribution.

Rate Limits & Pricing

TierRate LimitPriceAuth
Anonymous1,000 req/dayFreeNone (IP-based)
Developer1,000 req/dayFreeX-API-Key
Data Pro10,000 req/day$29/moX-API-Key
API 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

Compare API plans →

Quick start

Python
import requests

r = requests.get(
    "https://statisticsoftheworld.com/api/v2/history",
    params={"indicator": "NY.GDP.MKTP.CD", "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: "NY.GDP.MKTP.CD", 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 its latest indicator values. Upgrading preserves the public catalog and raises the request limit.

Example curl
curl https://statisticsoftheworld.com/api/v1/countries/USA
Response
{"country":{"id":"CAN","name":"Canada",...},"indicators":[{"id":"NY.GDP.MKTP.CD","value":2240000000000,...}]}
GET/api/v1/indicators

List 334 public indicators. Paid keys retain the public catalog and add higher request limits.

Example curl
curl https://statisticsoftheworld.com/api/v1/indicators
Response
{"count":334,"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},...]}
GET/api/v1/series

High-frequency catalog: daily yield curves and reference rates, central bank policy rates, monthly CPI for ~190 countries, unemployment, industrial production, electricity, and shipping activity. Every series carries machine-readable licence metadata.

Example curl
curl https://statisticsoftheworld.com/api/v1/series
Response
{"count":51,"data":[{"id":"UST.YC.10Y","frequency":"D","licence":"public-domain","resale_permitted":true,...}]}
GET/api/v1/series/:id

Observations for one series. ?geo=USA for one country, ?latest=1 for the newest value per country, ?from=YYYY-MM-DD to bound history.

Example curl
curl https://statisticsoftheworld.com/api/v1/series/USA
Response
{"series":{"id":"IMF.CPI.YOY.M","unit":"% y/y",...},"data":[{"geo":"USA","period":"2026-05","value":4.25},...]}
GET/api/v1/series/bulk

Stream the redistributable high-frequency corpus as CSV (?since=YYYY-MM-DD for increments). Rights are enforced per series for every tier.

Example curl
curl https://statisticsoftheworld.com/api/v1/series/bulk
Response
series_id,geo,freq,period,period_start,value,obs_status,licence\nUST.YC.10Y,USA,D,2026-07-17,2026-07-17,4.55,,public-domain

Data Sources

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