Free · No Auth Required

Build with SOTW Data

Global statistics, live markets, 49 commodities, 40+ currencies, and prediction markets — all free via API. Multiple integration methods.

🤖
MCP Server
For Claude Desktop, Claude Code, and MCP-compatible agents
REST API
25+ endpoints for country data, markets, predictions, and more
💬
Natural Language
Ask questions in plain English via /api/chat
📄
AI Discovery
llms.txt, OpenAPI 3.1, and GPT plugin manifest

🤖 MCP Server

The Model Context Protocol (MCP) lets AI agents like Claude directly query SOTW data. Two options: hosted remote server or local npm package.

Option 1: Remote MCP (Recommended)

Point your MCP client at our hosted endpoint. No installation needed.

// Claude Desktop config (~/.claude/claude_desktop_config.json)
{
  "mcpServers": {
    "statistics-of-the-world": {
      "type": "url",
      "url": "https://statisticsoftheworld.com/api/mcp"
    }
  }
}

Option 2: Local MCP Server

// Install globally
npm install -g @sotw/mcp-server

// Claude Desktop config
{
  "mcpServers": {
    "statistics-of-the-world": {
      "command": "npx",
      "args": ["@sotw/mcp-server"]
    }
  }
}

Available Tools (7)

ToolDescription
get_country_overviewAll key stats + AI narrative for a country
get_indicator_rankingRank countries by any indicator (top/bottom N)
get_historical_data20+ years of time series data
compare_countriesSide-by-side comparison of 2-10 countries
search_indicatorsFind indicators by keyword
get_available_indicatorsList all 443 indicators by category
get_country_listAll 218 countries with metadata

REST API

All endpoints are free, return JSON, and require no authentication. Add format=markdown to v2 endpoints for LLM-friendly output.

Country Data

443 indicators · 218 countries
GET/api/v2/country/:id

All indicators for a country with AI narrative and suggested follow-ups

curl https://statisticsoftheworld.com/api/v2/country/USA?format=markdown
GET/api/v2/indicator/:id

Country rankings by indicator with metadata and related indicators

curl "https://statisticsoftheworld.com/api/v2/indicator/IMF.NGDPD?limit=10&order=desc"
GET/api/v2/history

Historical time series (20+ years) with YoY, CAGR, min/max stats

curl "https://statisticsoftheworld.com/api/v2/history?indicator=IMF.NGDPD&country=USA"
GET/api/v1/search

Search indicators by keyword

curl "https://statisticsoftheworld.com/api/v1/search?q=gdp"
GET/api/v1/compare

Compare 2-10 countries side by side

curl "https://statisticsoftheworld.com/api/v1/compare?countries=USA,CHN,JPN"
GET/api/v1/countries

List all 218 countries with region, income level, capital

curl https://statisticsoftheworld.com/api/v1/countries
GET/api/v1/indicators

List all 443 indicators with categories

curl https://statisticsoftheworld.com/api/v1/indicators
POST/api/chat

Natural language query — ask anything about global statistics

curl -X POST https://statisticsoftheworld.com/api/chat \
  -H "Content-Type: application/json" \
  -d '{"message":"top 5 countries by GDP per capita"}'

Live Markets

25 indices · 49 commodities · 40+ FX
GET/api/quotes

Live prices for stock indices (25 countries), US futures, commodities, and FX pairs

curl https://statisticsoftheworld.com/api/quotes
GET/api/index-chart

Stock index chart data with configurable time range

curl "https://statisticsoftheworld.com/api/index-chart?id=YF.IDX.USA&range=1mo"
GET/api/commodity-chart

Commodity price chart data (Yahoo Finance)

curl "https://statisticsoftheworld.com/api/commodity-chart?id=YF.GOLD&range=3mo"
GET/api/china-quotes

Chinese commodity futures — 16 symbols from SHFE, DCE, ZCE exchanges

curl https://statisticsoftheworld.com/api/china-quotes
GET/api/china-chart

Chinese commodity chart data (Sina Finance)

curl "https://statisticsoftheworld.com/api/china-chart?id=SINA.COPPER&range=1mo"
GET/api/fx-chart

Currency pair chart data

curl "https://statisticsoftheworld.com/api/fx-chart?pair=EURUSD&range=1d"
GET/api/futures-curve

Futures term structure / forward curve

curl "https://statisticsoftheworld.com/api/futures-curve?id=YF.CRUDE_OIL"

Prediction Markets

Polymarket
GET/api/predictions

Real-money prediction markets with probability, volume, liquidity. Filter by category or search.

curl "https://statisticsoftheworld.com/api/predictions?limit=20&category=Elections+%26+Politics"

Economic Calendar

ForexFactory
GET/api/calendar

Upcoming economic events — GDP releases, CPI, FOMC, NFP, and more

curl https://statisticsoftheworld.com/api/calendar

Trade Data

UN COMTRADE
GET/api/trade

Bilateral trade flows — top import/export partners and product breakdown

curl "https://statisticsoftheworld.com/api/trade?country=USA"

Analytics

GET/api/forecasts

IMF 2-year forecasts for GDP growth, inflation, unemployment, etc.

curl "https://statisticsoftheworld.com/api/forecasts?indicator=IMF.NGDP_RPCH"
GET/api/correlations

Cross-indicator correlations (r-value, r-squared, sample size)

curl https://statisticsoftheworld.com/api/correlations
GET/api/heatmap

Multi-indicator country heatmap data with preset categories

curl https://statisticsoftheworld.com/api/heatmap
GET/api/sparklines

10-year sparkline data for any indicator across all countries

curl "https://statisticsoftheworld.com/api/sparklines?indicator=IMF.NGDP_RPCH"
GET/api/stock-profiles

Stock profiles — sector, industry, market cap for S&P 500, NASDAQ 100, etc.

curl https://statisticsoftheworld.com/api/stock-profiles
Chart ranges: All chart endpoints accept range parameter with values: 1d, 5d, 1mo, 3mo, 6mo, 1y, 5y, max

OpenAPI & GPT Actions

Use our OpenAPI 3.1 spec with any AI framework — LangChain, CrewAI, AutoGen, GPT Actions, and more.

# Python — LangChain
from langchain_community.tools import OpenAPIToolkit

toolkit = OpenAPIToolkit.from_openapi_spec(
    "https://statisticsoftheworld.com/api/openapi.json"
)

# JavaScript — fetch
const spec = await fetch("https://statisticsoftheworld.com/api/openapi.json")
  .then(r => r.json());

AI Discovery Files

Machine-readable files for AI crawlers and answer engines.

/llms.txtSite overview, all API endpoints, data coverage, key IDs
/api/openapi.jsonOpenAPI 3.1 specification
/.well-known/ai-plugin.jsonGPT Actions / ChatGPT plugin manifest

Key IDs Reference

Country Indicators

IMF.NGDPDGDP (nominal, USD billions)
IMF.NGDPDPCGDP per capita (USD)
IMF.NGDP_RPCHReal GDP growth (%)
IMF.PPPPCGDP per capita, PPP
SP.POP.TOTLPopulation
SP.DYN.LE00.INLife expectancy
IMF.PCPIPCHInflation rate (%)
IMF.LURUnemployment rate (%)
IMF.GGXWDG_NGDPGovernment debt (% GDP)
EN.GHG.CO2.PC.CE.AR5CO2 emissions per capita
SI.POV.GINIGini index (inequality)
MS.MIL.XPND.GD.ZSMilitary spending (% GDP)
SE.XPD.TOTL.GD.ZSEducation spending (% GDP)
SH.XPD.CHEX.GD.ZSHealth spending (% GDP)
IT.NET.USER.ZSInternet users (%)
NE.TRD.GNFS.ZSTrade openness (% GDP)

Stock Index IDs

YF.IDX.USAS&P 500 (United States)
YF.IDX.GBRFTSE 100 (United Kingdom)
YF.IDX.DEUDAX (Germany)
YF.IDX.JPNNikkei 225 (Japan)
YF.IDX.CHNSSE Composite (China)
YF.IDX.INDBSE Sensex (India)
YF.IDX.CANTSX Composite (Canada)
YF.IDX.AUSASX 200 (Australia)
YF.IDX.KORKOSPI (South Korea)
YF.IDX.BRABovespa (Brazil)
YF.FUT.SP500S&P 500 Futures
YF.FUT.NASDAQNASDAQ Futures

Commodity IDs

YF.GOLDGold
YF.SILVERSilver
YF.CRUDE_OILWTI Crude Oil
YF.BRENTBrent Crude
YF.NATGASNatural Gas
YF.COPPERCopper
YF.WHEATWheat
YF.CORNCorn
YF.SOYBEANSSoybeans
YF.COFFEECoffee
SINA.COPPERCopper (SHFE, China)
SINA.IRON_ORE_CNIron Ore (DCE, China)

FX Pairs & Prediction Categories

EURUSDEuro / US Dollar
USDJPYUS Dollar / Japanese Yen
GBPUSDBritish Pound / US Dollar
USDCADUS Dollar / Canadian Dollar
AUDUSDAustralian Dollar / US Dollar
USDCNYUS Dollar / Chinese Yuan
Prediction categories: Central Banks & Rates, Recession & Growth, Inflation & Prices, Elections & Politics, Geopolitics & Conflict, Trade & Tariffs, Crypto & Markets, Global Events

Example AI Workflows

What is the current gold price and how has it performed this year?
GET /api/quotes → filter YF.GOLD, then GET /api/commodity-chart?id=YF.GOLD&range=1y
Compare GDP growth forecasts for G7 countries
GET /api/v1/compare?countries=USA,CAN,GBR,FRA,DEU,ITA,JPN&indicators=IMF.NGDP_RPCH
What do prediction markets say about a US recession?
GET /api/predictions?category=Recession+%26+Growth
What economic data releases are coming this week?
GET /api/calendar
Which countries are the top trading partners of Germany?
GET /api/trade?country=DEU

Data Sources

IMF WEO
GDP, inflation, debt, fiscal
World Bank WDI
300+ development indicators
United Nations
Population, trade, SDGs
WHO GHO
30+ health indicators
FRED
US economy, bonds, rates
Yahoo Finance
Indices, commodities, FX
Sina Finance
Chinese commodity futures
Polymarket
Prediction markets
ForexFactory
Economic calendar
ECB
European exchange rates
UN COMTRADE
Bilateral trade flows
Finnhub
Stock market data