API Documentation
Free REST API for global statistics. JSON responses. No authentication required for basic access.
Base URL:
https://statisticsoftheworld.comBuilding 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
| Tier | Rate Limit | Price | Auth |
|---|---|---|---|
| Anonymous | 1,000 req/day | Free | None (IP-based) |
| Developer | 1,000 req/day | Free | X-API-Key |
| Pro | 50,000 req/day | $49/mo | X-API-Key |
| Enterprise | Unlimited | Custom | X-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 yearJavaScript
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 yearEndpoints
GET
/api/v1/countriesList all 218 countries with metadata.
Example curl
curl https://statisticsoftheworld.com/api/v1/countriesResponse
{"count":218,"data":[{"id":"USA","name":"United States","region":"North America",...}]}GET
/api/v1/countries/:idGet a single country with all latest indicator values.
Example curl
curl https://statisticsoftheworld.com/api/v1/countries/USAResponse
{"country":{"id":"CAN","name":"Canada",...},"indicators":[{"id":"IMF.NGDPD","value":2420000000000,...}]}GET
/api/v1/indicatorsList all 443 indicators with categories and metadata.
Example curl
curl https://statisticsoftheworld.com/api/v1/indicatorsResponse
{"count":443,"categories":[...],"data":[{"id":"SP.POP.TOTL","label":"Population",...}]}GET
/api/v1/indicators/:idGet a single indicator ranked across all countries.
Example curl
curl https://statisticsoftheworld.com/api/v1/indicators/USAResponse
{"indicator":{...},"count":192,"data":[{"rank":1,"countryId":"USA","value":31820000000000},...]}GET
/api/v1/history/:indicator/:countryGet 20+ years of historical data for an indicator-country pair.
Example curl
curl https://statisticsoftheworld.com/api/v1/history/SP.POP.TOTL/CANResponse
{"indicator":{...},"country":"CAN","data":[{"year":2000,"value":744631000000},{"year":2001,...}]}GET
/api/v1/rankings/:indicatorGet ranked list of countries for an indicator. Supports ?limit=N parameter.
Example curl
curl https://statisticsoftheworld.com/api/v1/rankings/SP.POP.TOTLResponse
{"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