How to Get World GDP & Economic Data via API

Free REST API. No API key. 440+ indicators for 218 countries. JSON responses.

Need GDP data for a project? Population figures for a dashboard? Inflation rates for a research paper? The Statistics of the World API gives you access to 440+ economic, demographic, and development indicators for 218 countries, all from IMF, World Bank, and WHO. It's free, requires no authentication, and returns clean JSON.

Base URL

text
https://statisticsoftheworld.com/api/v2

1. Get All Data for a Country

Returns every available indicator for a single country. Uses ISO 3166-1 alpha-3 country codes (USA, GBR, CHN, etc.).

curl
curl https://statisticsoftheworld.com/api/v2/country/USA
python
import requests

data = requests.get("https://statisticsoftheworld.com/api/v2/country/USA").json()

# Access GDP
gdp = data["indicators"]["IMF.NGDPD"]
print(f"US GDP: {'$'}{gdp['value']} billion ({gdp['year']})")

# Access population
pop = data["indicators"]["SP.POP.TOTL"]
print(f"US Population: {pop['value']:,.0f}")
javascript
const res = await fetch("https://statisticsoftheworld.com/api/v2/country/USA");
const data = await res.json();

console.log("US GDP:", data.indicators["IMF.NGDPD"]);
console.log("US Population:", data.indicators["SP.POP.TOTL"]);

2. Get Rankings for an Indicator

Returns all countries ranked by a specific indicator. Supports limit and order parameters.

curl
# Top 10 countries by GDP
curl "https://statisticsoftheworld.com/api/v2/indicator/IMF.NGDPD?limit=10&order=desc"

# Bottom 10 by life expectancy
curl "https://statisticsoftheworld.com/api/v2/indicator/SP.DYN.LE00.IN?limit=10&order=asc"
python
import requests

# Get top 10 economies
url = "https://statisticsoftheworld.com/api/v2/indicator/IMF.NGDPD?limit=10&order=desc"
top10 = requests.get(url).json()

for country in top10["data"]:
    print(f"{country['country']}: {'$'}{country['value']:.1f}B")

3. Get Historical Time Series

Returns 20+ years of historical data for any indicator and country combination.

curl
# US GDP history
curl "https://statisticsoftheworld.com/api/v2/history?indicator=IMF.NGDPD&country=USA"

# China inflation history
curl "https://statisticsoftheworld.com/api/v2/history?indicator=IMF.PCPIPCH&country=CHN"
python
import requests
import pandas as pd

url = "https://statisticsoftheworld.com/api/v2/history"
params = {"indicator": "IMF.NGDPD", "country": "USA"}
history = requests.get(url, params=params).json()

# Convert to DataFrame
df = pd.DataFrame(history["data"])
print(df.tail(10))  # Last 10 years of US GDP

Common Indicator IDs

IndicatorIDSource
GDP (Nominal USD)IMF.NGDPDIMF
GDP Growth RateIMF.NGDP_RPCHIMF
GDP per CapitaIMF.NGDPDPCIMF
Inflation RateIMF.PCPIPCHIMF
Unemployment RateIMF.LURIMF
Govt Debt (% GDP)IMF.GGXWDG_NGDPIMF
PopulationSP.POP.TOTLWorld Bank
Life ExpectancySP.DYN.LE00.INWorld Bank
Fertility RateSP.DYN.TFRT.INWorld Bank
CO₂ Emissions per CapitaEN.GHG.CO2.PC.CE.AR5World Bank
Gini IndexSI.POV.GINIWorld Bank
Internet Users (%)IT.NET.USER.ZSWorld Bank

Full list of 440+ indicators available at statisticsoftheworld.com/indicators and in our API documentation.

Rate Limits

TierRequests/DayAuth Required
Anonymous100No
Free (API key)1,000X-API-Key header
Pro50,000X-API-Key header

Use Cases

  • Dashboards and data visualizations
  • Academic research and economics papers
  • Journalism and data stories
  • AI/ML training data pipelines
  • Fintech apps and investment analysis
  • Educational tools and classroom exercises

FAQ

Is the API free?

Yes. 100 requests/day without any key. Get a free API key for 1,000 requests/day.

Do I need an API key?

No. The API works without authentication. API keys are optional and unlock higher rate limits.

What format is the response?

All endpoints return JSON. Country codes use ISO 3166-1 alpha-3 (USA, GBR, CHN, etc.).

Where does the data come from?

IMF World Economic Outlook, World Bank World Development Indicators, and WHO Global Health Observatory.

How often is the data updated?

Automatically when sources publish new data. IMF updates biannually, World Bank continuously.

Ready to start?

Try the API right now. No signup required.