Skip to content

World Bank API: Compare countries by a statistic

Ranks countries by a World Development Indicators statistic for a given year, or for the latest year with broad country coverage. Regional aggregates and countries without data for that year are left out.

worldbank.org (opens in a new tab)Version 1ReadNo sign-inVerified Nov 2, 2026

Unofficial. Not affiliated with or endorsed by World Bank.

Inputs

Values from the run on Oct 23, 2026, shown under Output.

Year optionalyear

Calendar year, for example 2022. Leave out to use the latest year with broad country coverage.

Not set

Whole number from 1960 to 2100.

Countries optionalcountries

Comma-separated country names, for example United States, Canada, France. Leave out to rank all countries.

United States, Canada

Default .

Statistic, requiredstatistic

Statistic in plain words, for example GDP per person or life expectancy.

infant mortality

Max Results optionalmax_results

Maximum number of ranked countries, for example 20.

20 (default)

Whole number from 1 to 250.

Output

From a run on Oct 23, 2026.
{  "unit": "per 1,000 live births",  "year": 2024,  "countries": [    {      "rank": 1,      "value": 5.5,      "country": "United States",      "page_link": "https://data.worldbank.org/indicator/SP.DYN.IMRT.IN?locations=USA",      "country_code": "USA"    },    {      "rank": 2,      "value": 4.7,      "country": "Canada",      "page_link": "https://data.worldbank.org/indicator/SP.DYN.IMRT.IN?locations=CAN",      "country_code": "CAN"    }  ],  "indicator_code": "SP.DYN.IMRT.IN",  "statistic_name": "Mortality rate, infant (per 1,000 live births)"}
Price
1 credit per completed run (1¢ with pay as you go); failed runs are free.
Method
worldbank.org/compare_countries
Returns
statistic name, unit, year, indicator code, ranked countries with values and chart links

Use it from your agent

Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method worldbank.org/compare_countries with the inputs above.

Ask your agent

  • Rank countries by life expectancy in 2021, top 15
  • Which countries have the highest GDP per person in 2022? Show me the top 20
  • Compare infant mortality rate for United States, Canada, Japan and Germany in 2019
  • On worldbank.org, rank all countries by CO2 emissions per person for the latest year
  • Show unemployment rate ranking for Brazil, Mexico, Chile, Argentina in 2020 with chart links
  • Looks up a World Bank statistic for a country and returns its annual values and latest value for the selected years.

    data.worldbank.org/get_country_statistic
  • Ranks countries by a World Economic Outlook indicator for a chosen year, excluding regional and group totals and countries without a value.

    imf.org/list_country_rankings
  • Finds the Our World in Data chart that best matches a statistic and returns its country-by-year numeric values, definition and source.

    ourworldindata.org/get_statistic
  • Compares the latest reported value of an economic indicator across countries in a region, highest first. World includes all listed countries; Australia uses the Oceania region.

    tradingeconomics.com/list_countries_by_indicator
  • Gets the latest WHO value of a health statistic for a country, with sex-specific values, the regional value for the same year, and up to 10 years of history.

    who.int/get_country_health_statistics
  • Ranks Premier League players for a season by goals, assists or goalkeeper clean sheets, with each player's club and nationality.

    premierleague.com/list_top_scorers
  • Ranks public companies worldwide, or by country and industry, by market cap, revenue, earnings, employees or dividend yield. When both a country and an industry are set, the industry ranking order is kept and only companies from that country are shown.

    companiesmarketcap.com/list_largest_companies
  • Looks up an official Eurostat statistic for an EU or EEA country and the EU27 figure for the same period. Quarterly and half-yearly series return the reporting period that contains a requested month.

    ec.europa.eu/get_statistic