DEV Community

Statistics of the World
Statistics of the World

Posted on

Free API for Global Economic Data — GDP, Population, Inflation for 218 Countries

I built a free REST API that provides economic data for every country in the world. No API key required for basic usage. Here's how it works and why I built it.

The Problem

If you've ever tried to get GDP, population, or inflation data programmatically, you know the pain:

  • World Bank API — works, but complex query syntax and XML responses
  • IMF API — even more complex, poorly documented
  • Trading Economics — paywalled ($50+/month)
  • FRED — great for US data, but limited international coverage

I wanted a single endpoint that returns clean JSON for any country, any indicator, with zero authentication.

The API

Base URL: https://statisticsoftheworld.com/api/v2

Get all indicators for a country

curl https://statisticsoftheworld.com/api/v2/country/USA
Enter fullscreen mode Exit fullscreen mode

Returns GDP, population, inflation, unemployment, government debt, life expectancy, and 440+ more indicators — all in one call.

Get one indicator for all countries (rankings)

curl https://statisticsoftheworld.com/api/v2/indicator/IMF.NGDPD
Enter fullscreen mode Exit fullscreen mode

Returns GDP for all 218 countries, sorted by value. Perfect for building rankings or visualizations.

Historical data

curl https://statisticsoftheworld.com/api/v2/history?indicator=IMF.NGDPD&country=USA
Enter fullscreen mode Exit fullscreen mode

Returns yearly GDP data for the US going back to 1980.

Data Sources

All data comes from official international organizations:

  • IMF World Economic Outlook — GDP, inflation, unemployment, government debt (193 countries)
  • World Bank WDI — 300+ development indicators (health, education, environment)
  • WHO — Health indicators (life expectancy, mortality rates)
  • FRED — US economic time series
  • United Nations — Population, trade statistics

Data is updated weekly as new releases become available.

No Auth, No Limits (almost)

  • No API key required for up to 100 requests/day
  • Free API key available for 1,000 requests/day (just sign up)
  • All responses are JSON
  • CORS enabled — works directly from the browser

Use Cases

  • 📊 Build data dashboards
  • 📈 Economic research and analysis
  • 🗺️ Country comparison tools
  • 📱 Mobile apps with global economic data
  • 🤖 Feed LLMs with structured economic context

Try It

The full site includes interactive charts, country comparisons, ranking tables, and a 2026 economic snapshot report — all free.

Would love feedback from anyone working with economic data. What indicators or features would be most useful for your projects?

Top comments (0)