Build with SOTW Data
Connect AI agents, LLMs, and applications to 443 indicators for 218 countries. Free. No paywall. 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 v2 (Agent-Optimized)
Enhanced endpoints that return enriched data with units, sources, related indicators, and suggested follow-up queries. Supports format=markdown for direct LLM consumption.
/api/v2/country/:idAll indicators for a country with AI narrative
curl https://statisticsoftheworld.com/api/v2/country/USA?format=markdown/api/v2/indicator/:idCountry rankings with metadata and related indicators
curl "https://statisticsoftheworld.com/api/v2/indicator/IMF.NGDPD?limit=10&order=desc"/api/v2/historyHistorical time series with summary stats (YoY, CAGR, min/max)
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 multiple countries
curl "https://statisticsoftheworld.com/api/v1/compare?countries=USA,CHN,JPN"/api/chatNatural language query (AI-powered)
curl -X POST https://statisticsoftheworld.com/api/chat -H "Content-Type: application/json" -d '{"message":"top 5 by GDP"}'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.txt | Concise site overview, API endpoints, data coverage |
| /llms-full.txt | Complete catalog of all 443 indicators with IDs |
| /api/openapi.json | OpenAPI 3.1 specification |
| /.well-known/ai-plugin.json | GPT Actions / ChatGPT plugin manifest |
Key Indicator IDs
Most commonly used indicator IDs for quick reference.
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)