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
| Parameter | Type | Description |
|---|---|---|
| mode | ENUM | What 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. |
| countries | String Array | ISO2 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. |
| indicators | String Array | World 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. |
| year | Integer | For rank: the year to rank. Default: the latest year where at least half of the reporting countries have data. |
| fromYear | Integer | For history and compare: the first year. Range: 1960 to 2027. Default: 20 years ago. |
| toYear | Integer | For history and compare: the last year. Default: the latest year. |
| limit | Integer | Maximum rows returned. Range: 1 to 100. Default: 20. |
| order | ENUM | For rank: the sort direction. Allowed values: desc, asc. Default: desc. desc puts the highest value first. |
| region | String | For rank: only countries of this World Bank region, for example Europe & Central Asia or Sub-Saharan Africa. |
| incomeGroup | String | For rank: only countries of this income group, for example High income or Lower middle income. |
| includeAggregates | Boolean | For rank and countries: also include groups such as World or Euro area. Default: not set. |
| query | String | For 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.
| Parameter | Type | Description |
|---|---|---|
| count | Integer | Number of rows in items. |
| items | Object Array | Result rows. |
| items[].country | String | Country or group name, for example United States. Not returned in search. |
| items[].iso2 | String | Two-letter country code. |
| items[].iso3 | String | Three-letter country code. |
| items[].indicator | String | World Bank indicator code, for example NY.GDP.MKTP.CD. Not returned in countries. |
| items[].indicatorName | String | Indicator name, for example GDP (current US$). Not returned in countries. |
| items[].year | Integer | Year of the value. Not returned in compare, search and countries. |
| items[].value | Number | The indicator value for that year. Not returned in compare, search and countries. |
| items[].unit | String | Unit of the value, for example current US$ or people. Not returned in countries. |
| items[].region | String | World Bank region of the country. Not returned in search. |
| items[].incomeGroup | String | World Bank income group of the country. Not returned in search. |
| items[].change | Number | latest only. Change versus the year before. |
| items[].changePct | Number | latest and compare. Change in percent. In latest it is versus the year before. In compare it is between startYear and endYear. |
| items[].previousYear | Integer | latest only. The year before. |
| items[].previousValue | Number | latest only. The value in the year before. |
| items[].yoyChange | Number | history only. Change versus the previous year. |
| items[].yoyChangePct | Number | history only. Change versus the previous year, in percent. |
| items[].rank | Integer | rank only. Position in the ranking, starting at 1. |
| items[].rankedOf | Integer | rank only. How many countries were ranked. |
| items[].startYear | Integer | compare only. First year of the comparison. |
| items[].endYear | Integer | compare only. Last year of the comparison. |
| items[].startValue | Number | compare only. Value in startYear. |
| items[].endValue | Number | compare only. Value in endYear. |
| items[].absoluteChange | Number | compare only. endValue minus startValue. |
| items[].cagrPct | Number | compare only. Average yearly growth rate in percent. |
| items[].dataPoints | Integer | compare only. Number of years with data. |
| items[].minValue | Number | compare only. Lowest value in the period. |
| items[].minYear | Integer | compare only. Year of the lowest value. |
| items[].maxValue | Number | compare only. Highest value in the period. |
| items[].maxYear | Integer | compare only. Year of the highest value. |
| items[].fromYear | Integer | compare only. The fromYear used. |
| items[].toYear | Integer | compare only. The toYear used. |
| items[].definition | String | search only. Plain definition of the indicator. |
| items[].score | Number | search only. How well the indicator matches query. Higher is better. |
| items[].sourceOrganization | String | search only. Organization that produces the indicator. |
| items[].topics | String Array | search only. World Bank topics of the indicator, for example Economy & Growth. |
| items[].isAggregate | Boolean | countries only. true for a group such as World, false for a single country. |
| items[].source | String | Data source, for example World Bank, World Development Indicators (CC BY 4.0). |
| items[].sourceUrl | String | Link to the source page. |
| items[].license | String | Data licence, for example CC BY 4.0. Not returned in countries. |
| items[].licenseUrl | String | Link to the licence. Not returned in countries. |
| items[].dataUpdated | String | Date the World Bank last updated the data, YYYY-MM-DD. Not returned in search and countries. |
| items[].fetchedAt | String | Time the service last refreshed the data, ISO 8601. |
| items[].stale | Boolean | true if the data could not be refreshed and an older copy is served. |
Notes
- Input errors return HTTP 400 with an error
message, for exampleField 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.



