API Documentation

Free REST API for global statistics. JSON responses. No authentication required for basic access.

Base URL: https://statisticsoftheworld.com

Build software and AI workflows

Use the REST API or connect an AI client through MCP. Data responses include source attribution and reuse metadata. Start free with 1,000 requests/day without a key.

API Pro includes the reviewed World Bank bulk bundle, archived IMF forecast panel, email support, and 50,000 API and MCP requests/day.

Catalog policy: API and MCP reads retain the same 337-indicator public catalog when a key is upgraded. Each response carries source-specific attribution and reuse metadata. Bulk files are a separate redistribution surface: the Data Pro bundle contains 283 reviewed World Bank indicators, and high-frequency bulk exports include only series cleared for redistribution.

Rate Limits & Pricing

TierRate LimitPriceAuth
Anonymous1,000 req/dayFreeNone (IP-based)
Developer1,000 req/dayFreeX-API-Key
Data Pro10,000 req/day$29/moX-API-Key
API Pro50,000 req/day$49/moX-API-Key
EnterpriseCustomCustomX-API-Key

Rate limit headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-RateLimit-Tier

Compare API plans →

Quick start

Python
import requests

r = requests.get(
    "https://statisticsoftheworld.com/api/v2/history",
    params={"indicator": "NY.GDP.MKTP.CD", "country": "USA"},
    headers={"X-API-Key": "sotw_YOUR_KEY"},  # optional under 1K/day
)
data = r.json()
print(data["data"][-1])  # latest year
JavaScript
const params = new URLSearchParams({ indicator: "NY.GDP.MKTP.CD", country: "USA" });
const res = await fetch(
  `https://statisticsoftheworld.com/api/v2/history?${params}`,
  { headers: { "X-API-Key": "sotw_YOUR_KEY" } } // optional under 1K/day
);
const data = await res.json();
console.log(data.data.at(-1)); // latest year

Endpoints

Each example is a real request with its response shortened (... marks removed fields), sampled on 2026-10-10. Values change as sources update. IMF values for the current year and later are projections from the World Economic Outlook.

GET/api/v1/discover

Search annual, qualified economic, other source series, onchain and company catalogs with q, kind, source, geo and market selectors. Economic and series geo membership is historical and does not prove fresh data or reviewed country definitions; kind=series exposes registry metadata with native history links, and keeps incomplete flag/release provenance explicit; unsupported geographic scopes are explicit. page/limit are coherent under the returned version; a changed version returns 409. Results retain exact identity, units, frequency, rights and workspace links.

Example curl
curl "https://statisticsoftheworld.com/api/v1/discover?q=gdp&kind=economic"
Response
Illustrative: {"version":"<catalog SHA256>","data":[{"kind":"economic","id":"EUROSTAT.GDP.YOY.Q",...}],...}
GET/api/v1/data-status

Country-level reference-age screens for reviewed macro definitions, separate source import ages and observed operating probes. geo/series filter matrix rows; matrix=1 returns all observed pairs. Summary counts retain the full reviewed scope. Optional release_acquisition exposes prospective BEA schedule-aware attempts and the latest successful source check; scheduled/declared release times do not establish upstream availability. Monthly, quarterly and annual reference-age windows are disclosed policy screens, not release deadlines. The operating baseline begins with actual collection and exposes missing/incomplete slots; one VPS observer cannot prove external uptime.

Example curl
curl "https://statisticsoftheworld.com/api/v1/data-status?geo=CAN"
Response
Illustrative: {"schema_version":1,"scope":"reviewed-public-macro-definitions","checked_at":"<UTC timestamp>","definitions":0,"matrix":[],"operating_baseline":{...},...}
GET/api/v1/companies

Reviewed SEC issuer catalog, or exact ten-digit cik and US GAAP tag. from/to filter fiscal period ends; filed_from/filed_to filter filing dates. limit is 1–1000; truncated is explicit and incomplete CSV exports return 409. value_text preserves exact decimal numbers; start/end dates, units, FY/FP, frame, accession and amendment context remain distinct. publication pins current registry coherence, not a historical filing snapshot. cik&evidence returns immutable acquisition receipts. An optional evidence-bound qualification discloses exact excluded inconsistent source contexts without correcting their dates or values; older unqualified evidence retains its original shape. Exact sector revenue/interest/premium tags remain distinct. Source numeric facts are available free; underlying filing text and taxonomy rights are not blanket public-domain claims.

Example curl
curl "https://statisticsoftheworld.com/api/v1/companies?cik=0000320193&tag=Assets"
Response
Illustrative: {"company":{"cik":"0000320193",...},"count":0,"truncated":false,"data":[{"value_text":"<exact decimal>","unit":"USD","end_date":"<fiscal date>","filed_date":"<filing date>","evidence_id":"<SHA256>",...}]}
GET/api/v1/onchain/history

Forward sampled pool states and perpetual midpoints. Requires market=pools|derivatives, an exact case-sensitive symbol and UTC from/to timestamps, maximum 31 days and 5000 rows. format=csv refuses row-cap truncation. Cadence, source times, quiet/unavailable statuses, missing collection slots, first acquisition and definition versions remain explicit. This archive does not reconstruct trades, OHLC, cash-security quotes or past readings before collection began.

Example curl
curl "https://statisticsoftheworld.com/api/v1/onchain/history?market=pools&symbol=PAXG&from=2026-10-11T00:00:00Z&to=2026-10-12T00:00:00Z"
Response
Illustrative: {"selection":{...},"data":[],"definitions":[],"notice":"Forward sampled observations",...}
GET/api/v1/economic-data

Reviewed GDP, inflation, jobs, trade, production, energy and credit series. format=catalog lists exact definitions, units, seasonality, source terms and historical coverage. Select exact series with latest=1 for its complete geography cohort, or geo for history; optional from/to and limit (maximum 20000). Original flags, qualifiers and currencies remain; unreliable readings have null value with raw_value preserved. format=csv downloads complete selections; format=manifest includes its exact checksum, publication pin and immutable observation evidence. generation guards current publication coherence. recorded=1, as_of (timestamp with timezone, up to six fractional digits) or revision (positive bigint string) selects the prospective full transaction archive. Retain both returned archive pins for replay. Before-coverage requests return 409; no past source history or original release/commit availability is inferred. Historical and current rights both apply, including BIS no-extra-charge conditions.

Example curl
curl "https://statisticsoftheworld.com/api/v1/economic-data?series=EUROSTAT.GDP.YOY.Q&latest=1"
Response
Illustrative structure: {"series":{"id":"EUROSTAT.GDP.YOY.Q","unit":"% y/y","definition":{...},"source_captures":[...]},"count":0,"truncated":false,"data":[{"geo":"DEU","period":"2026-Q2","value":null,"raw_value":null,"complete_status":null,"source_attributes":{...}}]}
GET/api/v1/calendar

Institutional release schedules with source links. Supports from/to dates and JSON, CSV or Markdown. Date passed does not confirm publication. JSON may include related current series data with its own period; it is not a verified release outcome. Invalid date windows or formats return 400; required data-read failures return 503/no-store.

Example curl
curl "https://statisticsoftheworld.com/api/v1/calendar?institution=BOC&format=json"
Response
{"from":"2026-10-10","to":"2027-04-08","count":6,"events":[{"institution":"BOC","institutionName":"Bank of Canada","report":"Business Outlook Survey and Canadian Survey of Consumer Expectations","date":"2026-10-19","time":"15:30","timezone":"UTC","status":"scheduled","statusBasis":"schedule_date","publicationConfirmed":false,"sourceUrl":"https://www.bankofcanada.ca/press/upcoming-events/",...},...],"meta":{"sources":[...],...}}
GET/api/v1/countries

List every country and territory in the catalog, plus the World aggregate row, with ISO codes, region, income level and capital. Optional limit and offset.

Example curl
curl "https://statisticsoftheworld.com/api/v1/countries?limit=2"
Response
{"count":2,"total":218,"offset":0,"limit":2,"data":[{"id":"AFG","iso2":"af","name":"Afghanistan","region":"Middle East, North Africa, Afghanistan & Pakistan","incomeLevel":"Low income","capitalCity":"Kabul",...},{"id":"ALB","iso2":"al","name":"Albania","region":"Europe & Central Asia",...}]}
GET/api/v1/countries/:id

Get one country (by ISO3 code) with the latest value of each indicator it has, each with its year, unit and source. Upgrading preserves the public catalog and raises the request limit.

Example curl
curl https://statisticsoftheworld.com/api/v1/countries/USA
Response
{"country":{"id":"USA","iso2":"us","name":"United States","region":"North America","incomeLevel":"High income","capitalCity":"Washington D.C."},"indicators":[{"id":"IMF.NGDPD","label":"GDP (Current USD)","category":"Economy","value":32383920000000,"year":"2026","format":"currency","unit":"current US dollars","source":"imf",...},{"id":"SP.POP.TOTL","label":"Population","value":341784857,"year":"2025","source":"wb",...},...],"meta":{"attribution":{...}}}
GET/api/v1/indicators

List 337 public indicators. Optional category, limit and offset. Paid keys retain the public catalog and add higher request limits.

Example curl
curl "https://statisticsoftheworld.com/api/v1/indicators?limit=1"
Response
{"count":1,"total":337,"offset":0,"limit":1,"categories":["Economy",...],"data":[{"id":"IMF.NGDPD","label":"GDP (Current USD)","category":"Economy","format":"currency","unit":"current US dollars","source":"imf","sourceName":"International Monetary Fund (World Economic Outlook)"}]}
GET/api/v1/indicators/:id

Get one indicator (by indicator ID) ranked across all countries, with its definition and source.

Example curl
curl https://statisticsoftheworld.com/api/v1/indicators/IMF.NGDPD
Response
{"indicator":{"id":"IMF.NGDPD","label":"GDP (Current USD)","category":"Economy","format":"currency","source":"imf","unit":"current US dollars",...},"count":192,"data":[{"rank":1,"countryId":"USA","country":"United States","value":32383920000000,"year":"2026"},{"rank":2,"countryId":"CHN","country":"China","value":20851593000000,"year":"2026"},...],"meta":{"attribution":{...}}}
GET/api/v1/search

Search the indicator catalog by name, category or code with q, or list one category with category. A text search also returns matching countries. Optional limit (default 20, at most 50).

Example curl
curl "https://statisticsoftheworld.com/api/v1/search?q=inflation&limit=2"
Response
{"query":"inflation","count":2,"total":3,"data":[{"id":"IMF.PCPIPCH","label":"Inflation, Consumer Prices (%)","category":"Fiscal & Monetary","format":"percent","unit":"annual percent change in average consumer prices","source":"imf",...},{"id":"FP.CPI.TOTL.ZG","label":"Inflation, CPI (%, World Bank)","source":"wb",...}],"countryCount":0,"countries":[]}
GET/api/v1/history/:indicator/:country

Get available historical data for an indicator-country pair. ECB.EXRATE includes each reading’s historical quote currency per EUR, annual reference boundaries, publisher status/comment, compilation note and immutable capture link. A normal source status does not certify final observed data; RON and TRY already include the publisher’s redenomination adjustment.

Example curl
curl https://statisticsoftheworld.com/api/v1/history/SP.POP.TOTL/CAN
Response
{"indicator":{"id":"SP.POP.TOTL","label":"Population","format":"number","source":"wb","unit":"people",...},"country":"CAN","count":66,"data":[{"year":1960,"value":17909356},{"year":1961,"value":18271000},...,{"year":2025,"value":41651653}],"meta":{"attribution":{...}}}
GET/api/v1/rankings/:indicator

Get ranked list of countries for an indicator. Supports ?limit=N, and format=csv for indicators cleared for redistribution (others return 403 and stay readable as JSON).

Example curl
curl "https://statisticsoftheworld.com/api/v1/rankings/SP.POP.TOTL?limit=3"
Response
{"indicator":{"id":"SP.POP.TOTL","label":"Population","category":"People","format":"number","source":"wb","unit":"people",...},"count":3,"total":217,"data":[{"rank":1,"countryId":"IND","country":"India","value":1463865525,"year":"2025"},{"rank":2,"countryId":"CHN","country":"China","value":1406585000,"year":"2025"},{"rank":3,"countryId":"USA","country":"United States","value":341784857,"year":"2025"}],"meta":{"attribution":{...}}}
GET/api/v1/onchain/quotes

SOTW-calculated Uniswap, Raydium and PancakeSwap pool observations for crypto, stablecoins, gold tokens and tokenized stocks/ETFs. Ethereum/Solana quote Circle USDC; BNB quotes Binance-Peg USD Coin with same-block USDT conversions. These are separate instruments from underlying cash securities. Includes chain timestamps, recorded pool oracle observation times, source links, multipliers and block/slot proof. Filter by category or comma-separated symbols. Invalid selectors return 400; unavailable prices are null, and all-source failure returns 503. No historical archive is implied.

Example curl
curl "https://statisticsoftheworld.com/api/v1/onchain/quotes?symbols=PAXG,AAPLx"
Response
{"quoteCurrency":"USDC","partial":false,"quotes":[{"symbol":"AAPLx","category":"tokenized-equity","price":null,"status":"unavailable","chainTime":null,"poolObservationAt":null,...}],...}
GET/api/v1/onchain/assets

Reviewed onchain instrument and pool catalog. Lists token symbols, instrument types, chains and addresses without calling an upstream price feed. Use /api/v1/onchain/stream for server-sent snapshot events; one connection is metered once and expires with a reconnect event after ten minutes. Streaming shares the collector with REST.

Example curl
curl "https://statisticsoftheworld.com/api/v1/onchain/assets"
Response
{"count":68,"quoteCurrency":"USDC","assets":[{"symbol":"PAXG","category":"tokenized-gold","chain":"Ethereum",...}]}
GET/api/v1/onchain/derivatives

SOTW-calculated bid/ask midpoints for reviewed Hyperliquid perpetual contracts linked to global stocks, regional and sector ETFs, precious metals, oil, natural gas, currencies, indices and Treasury yields. Each row keeps its reference units, source book time, bid, ask, spread and depth. Collateral is USDC; quote units can be USD/share, USD/barrel, JPY/USD, index points or percent yield. These are derivative prices, not cash-market or official economic readings. Books older than 15 seconds, inactive contracts, invalid books, spreads above 100 bps and insufficient two-sided depth return null. One shared public stream supplies every viewer. Use /api/v1/onchain/stream?market=derivatives for five-second SSE snapshots.

Example curl
curl "https://statisticsoftheworld.com/api/v1/onchain/derivatives?symbols=xyz:SILVER,xyz:CL,xyz:JPY,para:10Y"
Response
{"count":4,"quotes":[{"symbol":"xyz:SILVER","instrumentType":"perpetual","unit":"USD / troy oz","price":null,"status":"unavailable","sourceTime":null,...}],"quality":{"maxAgeSeconds":15,"maxSpreadBps":100,...}}
GET/api/v1/onchain/derivatives/assets

Reviewed perpetual-contract catalog with reference units, market identity, collateral, source links and excluded candidates. A listing is distinct from a currently qualified quote. Public source access does not grant a blanket licence to redistribute underlying exchange, index, oracle or reference feeds.

Example curl
curl "https://statisticsoftheworld.com/api/v1/onchain/derivatives/assets"
Response
{"count":123,"instrumentType":"perpetual","categories":["equities","etfs","commodities","currencies","indices","rates"],"assets":[...],"excluded":[...]}
GET/api/v1/source-comparisons

Research pilot: compare IMF and World Bank readings for 10 macro concepts and 20 economies. Select concept, country and year=common or an exact year (1960–2100). Optional as_of selects transaction-final SOTW recording time; revision and processing_version pin an earlier result. Dates mean UTC midnight. Publisher vintage, observation status, source publication and database commit availability remain unknown. Rate differences use percentage points; incompatible scopes and unreviewed units suppress differences. format=evidence downloads a JSON manifest, data checksum and raw stored revision timeline. Raw publisher files stay private. Before-coverage requests return 409; invalid selectors return 400; failed reads or an active capture return 503/no-store. Coverage begins at migration installation, with existing rows recorded as a baseline.

Example curl
curl "https://statisticsoftheworld.com/api/v1/source-comparisons?concept=gdp&country=CAN&year=2025&format=evidence"
Response
Illustrative structure: {"comparisonYear":2025,"difference":{"label":"IMF minus World Bank","status":"comparable",...},"provenance":{"timeBasis":"sotw_recorded_at","sourceAvailability":"not_established","asOf":"...","revision":"..."},...}
GET/api/v1/series

High-frequency catalog: daily yield curves and reference rates, central bank policy rates, monthly CPI for ~190 countries, unemployment, industrial production, electricity, and shipping activity. Every series carries machine-readable licence metadata.

Example curl
curl https://statisticsoftheworld.com/api/v1/series
Response
{"count":171,"data":[...,{"id":"UST.YC.10Y","label":"U.S. Treasury Par Yield 10 Year","category":"Interest Rates","unit":"% p.a.","frequency":"D","licence":"public-domain","resale_permitted":true,...},...]}
GET/api/v1/series/:id

Observations for one series. ?geo=USA selects a country, ?latest=1 returns the newest stored reading for every geography, and ?from=YYYY-MM-DD bounds history. Check each reading’s period; latest dates can differ across countries.

Example curl
curl "https://statisticsoftheworld.com/api/v1/series/BIS.CBPOL.D?latest=1"
Response
{"series":{"id":"BIS.CBPOL.D","label":"Central Bank Policy Rate (Daily)","category":"Interest Rates","unit":"% p.a.","frequency":"D","format":"percent","source":"bis",...},"count":40,"data":[{"geo":"TUR","period":"2026-10-02","period_start":"2026-10-02","value":37,"obs_status":null},{"geo":"ARG","period":"2025-07-10","period_start":"2025-07-10","value":29,"obs_status":null},...],"meta":{"attribution":{...}}}
GET/api/v1/series/bulk

Stream the redistributable high-frequency corpus as CSV (?since=YYYY-MM-DD for increments). Rights are enforced per series for every tier.

Example curl
curl https://statisticsoftheworld.com/api/v1/series/bulk -o sotw-series.csv
Response
series_id,geo,freq,period,period_start,value,obs_status,licence\nUST.YC.10Y,USA,D,2026-07-17,2026-07-17,4.55,,public-domain
GET/api/v1/open/observations.csv

The open slice of the bulk export, with the same columns: every reading of the high-frequency series whose source licences are open. Our own work on it is released under CC BY 4.0 and each row keeps its source licence. /api/v1/open/datapackage.json describes it as a Frictionless Data Package and lists every series with its unit, publisher and credit line. Licence statement: /open-data.

Example curl
curl https://statisticsoftheworld.com/api/v1/open/observations.csv -o sotw-open-observations.csv
Response
series_id,geo,freq,period,period_start,value,obs_status,licence\nUST.YC.10Y,USA,D,2026-07-17,2026-07-17,4.55,,public-domain
GET/api/v1/forecast-revisions/:country

Stored IMF World Economic Outlook readings for six subjects, by release. Accepts an IMF country code or a recognized country slug. Free access returns JSON for one target_year (1980–2100, default current UTC year), showing subjects with at least two releases with figures. A paid key with full=1 returns up to the latest 60 stored target years as JSON or format=csv. Coverage metadata identifies missing values and any year-window limit. Percentage-series revisions are percentage points. Read failures return 503/no-store, not partial data or false absence. Release labels and year offsets do not tell you whether a reading is an observation or a forecast, and the archive is our stored copy of the published figures, not the IMF’s original files.

Example curl
curl https://statisticsoftheworld.com/api/v1/forecast-revisions/CAN
Response
{"country":"CAN","targetYear":2026,"tier":"anonymous","scope":"single-year","vintageCount":10,"oldestVintage":"2021-04","newestVintage":"2026-04","coverage":{...},"series":[{"indicator":"NGDP_RPCH","label":"Real GDP growth","unit":"%","source":"IMF","firstEstimate":{"vintage":"2021-04","value":1.549,...},"latest":{"vintage":"2026-04","value":1.5,...},"totalRevision":-0.049,"revisionUnit":"percentage points",...},...]}
GET/api/pro/dataset

Paid bulk files, authenticated with X-API-Key. file=latest, dictionary, countries and license accompany the reviewed World Bank bundle; calendar contains independently sourced institutional schedules. file=forecast-revisions streams the stored IMF panel for six subjects (1.32M+ numeric rows, about 66 MB), with forecast-dictionary and forecast-license alongside it. Forecast headers identify the database read, export generation and omitted null-value rows. Each CSV chunk is checked against the complete generation; preflight failure returns 503 and later failure aborts the download. Keep source_unit_code unchanged and use the dictionary for scale and geography caveats; country_iso3 includes non-ISO3 source codes. Call with no file parameter to check entitlement.

Example curl
curl -H "X-API-Key: sotw_…" "https://statisticsoftheworld.com/api/pro/dataset?file=forecast-revisions" -o sotw-forecast-revisions.csv
Response
source,vintage,country_iso3,indicator_id,target_year,horizon,value,source_unit_code\nIMF,2019-10,CAN,NGDP_RPCH,2020,1,1.821,pcent_change

Series history and failed reads

For /api/v1/series/:id, ?as_of=YYYY-MM-DD applies recorded value revisions from an archive collected since July 18, 2026. It is a partial rollback of current rows, not a complete historical snapshot: insertions, deletions and status-only changes are not reconstructed. Read the response’s provenance details before relying on a historical selection.

The complete cross-geography mode, latest=1, cannot be combined with geo, from, to, limit or as_of; incompatible parameters return 400. Invalid cutoffs and dates before the archive began also return 400. A successfully checked unknown series returns 404. Failed catalog, observation or revision reads return 503 with Cache-Control: no-store; successful empty results remain distinct from failures.

For series bulk CSV, a catalog failure is rejected before streaming. A later chunk failure interrupts the stream. Discard an interrupted file and retry; its initial HTTP status alone does not establish a complete download.

Data Sources

IMF World Economic Outlook
World Bank WDI
WHO Global Health Observatory
United Nations
OECD
European Central Bank
Yahoo Finance