apyhub
Back
▣ RETRIEVAL KIT

World Bank Economic Indicators API

What it does

The World Bank Economic Indicators API returns country data from the World Bank, such as GDP, population, inflation, unemployment and life expectancy. Send a mode, plus the countries and indicators you want, and get back rows with the value, the year, the region and the income group. Every row names its source and its CC BY 4.0 licence.

Pick what you get with mode. latest returns the newest value per country and indicator, with the change from the year before. history returns one row per year between fromYear (1960 or later) and toYear. rank sorts countries by one indicator for one year, and you can filter by region or incomeGroup. compare measures growth between two years, with the total change, the yearly growth rate, the lowest value and the highest value. search finds indicator codes from the words in query. countries lists the countries, and with includeAggregates it also lists groups such as World or Euro area.

Send up to 20 countries and up to 10 indicators per call. Name countries by ISO2 code, ISO3 code or English name, and indicators by World Bank code or plain words such as gdp. Use limit (1 to 100, default 20) to cap the rows.

Teams use this World Bank economic indicators API for country dashboards, macroeconomic research, country comparisons and automated reports.

Data comes from the World Bank, World Development Indicators. AI agents can call it through ApyHub MCP.

POST
World Bank Economic Indicators API
https://api.eu.apyhub.com/martin10291/world-bank-economic-indicators

QUICKSTART

GUIDE

Quickstart

Get the newest population figure for two countries.

curl -X POST "https://api.eu.apyhub.com/martin10291/world-bank-economic-indicators" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"latest","countries":["US","DE"],"indicators":["population"]}'

What you'll get back

Returns a JSON object with a count integer and an items array. Each item is one country and indicator, with the latest value, the change versus the year before, and the source and licence.

{
  "count": 2,
  "items": [
    {
      "change": 1781060,
      "changePct": 0.5238,
      "country": "United States",
      "dataUpdated": "2026-11-11",
      "fetchedAt": "2026-12-01T06:50:18Z",
      "incomeGroup": "High income",
      "indicator": "SP.POP.TOTL",
      "indicatorName": "Population, total",
      "iso2": "US",
      "iso3": "USA",
      "license": "CC BY 4.0",
      "licenseUrl": "https://datacatalog.worldbank.org/public-licenses#cc-by",
      "previousValue": 340003797,
      "previousYear": 2024,
      "region": "North America",
      "source": "World Bank, World Development Indicators (CC BY 4.0)",
      "sourceUrl": "https://data.worldbank.org/indicator/SP.POP.TOTL",
      "stale": false,
      "unit": "people",
      "value": 341784857,
      "year": 2025
    }
  ]
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
What to return: latest, history, rank, compare, search or countries.
For rank: the year to rank. Default: the latest year where at least half of the reporting countries have data.
Maximum rows returned.

About this endpoint

What it does

Queries World Bank economic indicators and returns a JSON object with a row count and an items array. The mode field decides what each row holds: the latest value, a yearly history, a country ranking, a growth comparison between two years, an indicator search, or a country list.

Request Body

ParameterTypeDescription
modeENUMWhat to return. Allowed values: latest, history, rank, compare, search, countries. Default: latest. latest returns the newest value per country and indicator, with the change versus the year before. history returns one row per country, indicator and year. rank ranks countries by one indicator in one year. compare measures growth of one indicator between two years per country. search finds indicator codes by keyword. countries lists countries.
countriesString ArrayISO2 codes (US, DE, BG), ISO3 codes (USA, DEU) or English names (Germany). Groups also work (WLD for world, EUU for the EU, HIC for high income). Max 20 items. In latest mode, send at least one of countries or indicators.
indicatorsString ArrayWorld Bank codes (NY.GDP.MKTP.CD) or plain words (gdp, inflation, population, unemployment, gdp per capita, co2 per capita, life expectancy, internet users). Max 10 items. rank and compare use the first one. Use mode search to find codes.
yearIntegerFor rank: the year to rank. Default: the latest year where at least half of the reporting countries have data.
fromYearIntegerFor history and compare: the first year. Range: 1960 to 2027. Default: 20 years ago.
toYearIntegerFor history and compare: the last year. Default: the latest year.
limitIntegerMaximum rows returned. Range: 1 to 100. Default: 20.
orderENUMFor rank: the sort direction. Allowed values: desc, asc. Default: desc. desc puts the highest value first.
regionStringFor rank: only countries of this World Bank region, for example Europe & Central Asia or Sub-Saharan Africa.
incomeGroupStringFor rank: only countries of this income group, for example High income or Lower middle income.
includeAggregatesBooleanFor rank and countries: also include groups such as World or Euro area. Default: not set.
queryStringFor search: the words to find, for example gdp per capita or female unemployment. Only indicators under the CC BY 4.0 licence are returned. Restricted series (ESMAP/IEA, SIPRI) are excluded.

Response

Returns a JSON object with a count integer and an items array. Each item is one row. Which fields appear depends on mode: the fields marked for a mode below appear only in that mode, and the rest appear in most modes.

ParameterTypeDescription
countIntegerNumber of rows in items.
itemsObject ArrayResult rows.
items[].countryStringCountry or group name, for example United States. Not returned in search.
items[].iso2StringTwo-letter country code.
items[].iso3StringThree-letter country code.
items[].indicatorStringWorld Bank indicator code, for example NY.GDP.MKTP.CD. Not returned in countries.
items[].indicatorNameStringIndicator name, for example GDP (current US$). Not returned in countries.
items[].yearIntegerYear of the value. Not returned in compare, search and countries.
items[].valueNumberThe indicator value for that year. Not returned in compare, search and countries.
items[].unitStringUnit of the value, for example current US$ or people. Not returned in countries.
items[].regionStringWorld Bank region of the country. Not returned in search.
items[].incomeGroupStringWorld Bank income group of the country. Not returned in search.
items[].changeNumberlatest only. Change versus the year before.
items[].changePctNumberlatest and compare. Change in percent. In latest it is versus the year before. In compare it is between startYear and endYear.
items[].previousYearIntegerlatest only. The year before.
items[].previousValueNumberlatest only. The value in the year before.
items[].yoyChangeNumberhistory only. Change versus the previous year.
items[].yoyChangePctNumberhistory only. Change versus the previous year, in percent.
items[].rankIntegerrank only. Position in the ranking, starting at 1.
items[].rankedOfIntegerrank only. How many countries were ranked.
items[].startYearIntegercompare only. First year of the comparison.
items[].endYearIntegercompare only. Last year of the comparison.
items[].startValueNumbercompare only. Value in startYear.
items[].endValueNumbercompare only. Value in endYear.
items[].absoluteChangeNumbercompare only. endValue minus startValue.
items[].cagrPctNumbercompare only. Average yearly growth rate in percent.
items[].dataPointsIntegercompare only. Number of years with data.
items[].minValueNumbercompare only. Lowest value in the period.
items[].minYearIntegercompare only. Year of the lowest value.
items[].maxValueNumbercompare only. Highest value in the period.
items[].maxYearIntegercompare only. Year of the highest value.
items[].fromYearIntegercompare only. The fromYear used.
items[].toYearIntegercompare only. The toYear used.
items[].definitionStringsearch only. Plain definition of the indicator.
items[].scoreNumbersearch only. How well the indicator matches query. Higher is better.
items[].sourceOrganizationStringsearch only. Organization that produces the indicator.
items[].topicsString Arraysearch only. World Bank topics of the indicator, for example Economy & Growth.
items[].isAggregateBooleancountries only. true for a group such as World, false for a single country.
items[].sourceStringData source, for example World Bank, World Development Indicators (CC BY 4.0).
items[].sourceUrlStringLink to the source page.
items[].licenseStringData licence, for example CC BY 4.0. Not returned in countries.
items[].licenseUrlStringLink to the licence. Not returned in countries.
items[].dataUpdatedStringDate the World Bank last updated the data, YYYY-MM-DD. Not returned in search and countries.
items[].fetchedAtStringTime the service last refreshed the data, ISO 8601.
items[].staleBooleantrue if the data could not be refreshed and an older copy is served.

Notes

  • Input errors return HTTP 400 with an error message, for example Field limit must be between 1 and 100, got 101.
  • An unknown country or indicator returns HTTP 400, not an empty list.
  • Series that are not under the CC BY 4.0 licence are left out.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.