Build with SOTW Data

Connect AI agents, LLMs, and applications to 443 indicators for 218 countries. Free. No paywall. Multiple integration methods.

🤖
MCP Server
For Claude Desktop, Claude Code, and MCP-compatible agents
REST API v2
Agent-optimized endpoints with context, suggestions, and markdown
💬
Natural Language
Ask questions in plain English via /api/chat

🤖 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 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.

GET/api/v2/country/:id

All indicators for a country with AI narrative

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

Country rankings 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 with summary stats (YoY, CAGR, min/max)

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 multiple countries

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

Natural 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.txtConcise site overview, API endpoints, data coverage
/llms-full.txtComplete catalog of all 443 indicators with IDs
/api/openapi.jsonOpenAPI 3.1 specification
/.well-known/ai-plugin.jsonGPT 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, 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)

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
Stock indices, commodities, FX
ECB
European exchange rates
UN COMTRADE
International trade flows