Build with SOTW Data
Global statistics, live markets, 49 commodities, 40+ currencies, and prediction markets — all free via API. Multiple integration methods.
🤖 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)
| Tool | Description |
|---|---|
| get_country_overview | All key stats + AI narrative for a country |
| get_indicator_ranking | Rank countries by any indicator (top/bottom N) |
| get_historical_data | 20+ years of time series data |
| compare_countries | Side-by-side comparison of 2-10 countries |
| search_indicators | Find indicators by keyword |
| get_available_indicators | List all 443 indicators by category |
| get_country_list | All 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/api/v2/country/:idAll indicators for a country with AI narrative and suggested follow-ups
curl https://statisticsoftheworld.com/api/v2/country/USA?format=markdown/api/v2/indicator/:idCountry rankings by indicator with metadata and related indicators
curl "https://statisticsoftheworld.com/api/v2/indicator/IMF.NGDPD?limit=10&order=desc"/api/v2/historyHistorical time series (20+ years) with YoY, CAGR, min/max stats
curl "https://statisticsoftheworld.com/api/v2/history?indicator=IMF.NGDPD&country=USA"/api/v1/searchSearch indicators by keyword
curl "https://statisticsoftheworld.com/api/v1/search?q=gdp"/api/v1/compareCompare 2-10 countries side by side
curl "https://statisticsoftheworld.com/api/v1/compare?countries=USA,CHN,JPN"/api/v1/countriesList all 218 countries with region, income level, capital
curl https://statisticsoftheworld.com/api/v1/countries/api/v1/indicatorsList all 443 indicators with categories
curl https://statisticsoftheworld.com/api/v1/indicators/api/chatNatural 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/api/quotesLive prices for stock indices (25 countries), US futures, commodities, and FX pairs
curl https://statisticsoftheworld.com/api/quotes/api/index-chartStock index chart data with configurable time range
curl "https://statisticsoftheworld.com/api/index-chart?id=YF.IDX.USA&range=1mo"/api/commodity-chartCommodity price chart data (Yahoo Finance)
curl "https://statisticsoftheworld.com/api/commodity-chart?id=YF.GOLD&range=3mo"/api/china-quotesChinese commodity futures — 16 symbols from SHFE, DCE, ZCE exchanges
curl https://statisticsoftheworld.com/api/china-quotes/api/china-chartChinese commodity chart data (Sina Finance)
curl "https://statisticsoftheworld.com/api/china-chart?id=SINA.COPPER&range=1mo"/api/fx-chartCurrency pair chart data
curl "https://statisticsoftheworld.com/api/fx-chart?pair=EURUSD&range=1d"/api/futures-curveFutures term structure / forward curve
curl "https://statisticsoftheworld.com/api/futures-curve?id=YF.CRUDE_OIL"Prediction Markets
Polymarket/api/predictionsReal-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/api/calendarUpcoming economic events — GDP releases, CPI, FOMC, NFP, and more
curl https://statisticsoftheworld.com/api/calendarTrade Data
UN COMTRADE/api/tradeBilateral trade flows — top import/export partners and product breakdown
curl "https://statisticsoftheworld.com/api/trade?country=USA"Analytics
/api/forecastsIMF 2-year forecasts for GDP growth, inflation, unemployment, etc.
curl "https://statisticsoftheworld.com/api/forecasts?indicator=IMF.NGDP_RPCH"/api/correlationsCross-indicator correlations (r-value, r-squared, sample size)
curl https://statisticsoftheworld.com/api/correlations/api/heatmapMulti-indicator country heatmap data with preset categories
curl https://statisticsoftheworld.com/api/heatmap/api/sparklines10-year sparkline data for any indicator across all countries
curl "https://statisticsoftheworld.com/api/sparklines?indicator=IMF.NGDP_RPCH"/api/stock-profilesStock profiles — sector, industry, market cap for S&P 500, NASDAQ 100, etc.
curl https://statisticsoftheworld.com/api/stock-profilesrange parameter with values: 1d, 5d, 1mo, 3mo, 6mo, 1y, 5y, maxOpenAPI & 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.txt | Site overview, all API endpoints, data coverage, key IDs |
| /api/openapi.json | OpenAPI 3.1 specification |
| /.well-known/ai-plugin.json | GPT 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, PPPSP.POP.TOTLPopulationSP.DYN.LE00.INLife expectancyIMF.PCPIPCHInflation rate (%)IMF.LURUnemployment rate (%)IMF.GGXWDG_NGDPGovernment debt (% GDP)EN.GHG.CO2.PC.CE.AR5CO2 emissions per capitaSI.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 FuturesYF.FUT.NASDAQNASDAQ FuturesCommodity IDs
YF.GOLDGoldYF.SILVERSilverYF.CRUDE_OILWTI Crude OilYF.BRENTBrent CrudeYF.NATGASNatural GasYF.COPPERCopperYF.WHEATWheatYF.CORNCornYF.SOYBEANSSoybeansYF.COFFEECoffeeSINA.COPPERCopper (SHFE, China)SINA.IRON_ORE_CNIron Ore (DCE, China)FX Pairs & Prediction Categories
EURUSDEuro / US DollarUSDJPYUS Dollar / Japanese YenGBPUSDBritish Pound / US DollarUSDCADUS Dollar / Canadian DollarAUDUSDAustralian Dollar / US DollarUSDCNYUS Dollar / Chinese Yuan