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
https://statisticsoftheworld.com/api/v21. 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 https://statisticsoftheworld.com/api/v2/country/USAimport 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}")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.
# 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"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.
# 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"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 GDPCommon Indicator IDs
| Indicator | ID | Source |
|---|---|---|
| GDP (Nominal USD) | IMF.NGDPD | IMF |
| GDP Growth Rate | IMF.NGDP_RPCH | IMF |
| GDP per Capita | IMF.NGDPDPC | IMF |
| Inflation Rate | IMF.PCPIPCH | IMF |
| Unemployment Rate | IMF.LUR | IMF |
| Govt Debt (% GDP) | IMF.GGXWDG_NGDP | IMF |
| Population | SP.POP.TOTL | World Bank |
| Life Expectancy | SP.DYN.LE00.IN | World Bank |
| Fertility Rate | SP.DYN.TFRT.IN | World Bank |
| CO₂ Emissions per Capita | EN.GHG.CO2.PC.CE.AR5 | World Bank |
| Gini Index | SI.POV.GINI | World Bank |
| Internet Users (%) | IT.NET.USER.ZS | World Bank |
Full list of 440+ indicators available at statisticsoftheworld.com/indicators and in our API documentation.
Rate Limits
| Tier | Requests/Day | Auth Required |
|---|---|---|
| Anonymous | 100 | No |
| Free (API key) | 1,000 | X-API-Key header |
| Pro | 50,000 | X-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.