# World Bank API: Get country statistic

> Looks up a World Bank statistic for a country and returns its annual values and latest value for the selected years.

Unofficial. Not affiliated with or endorsed by World Bank.

- Page: https://fous.com/methods/data.worldbank.org/get-country-statistic
- Method: `data.worldbank.org/get_country_statistic`, version 1
- Website: data.worldbank.org
- Returns: country, statistic, unit, latest value and year, annual values, source, data page link
- Effect: read (it gets data and changes nothing)
- Sign-in: none needed
- Cost: 1 credit per completed run (1¢ with pay as you go); failed runs are free
- Verified: Nov 2, 2026

## Inputs

| Field | Type | Required | In the run below | Description |
|---|---|---|---|---|
| `country` | string | yes | `"South Korea"` | Country name, such as Brazil. |
| `to_year` | integer | no |  | Last year to include, such as 2023. Defaults to the most recent year with data. |
| `from_year` | integer | no |  | First year to include, such as 2015. Defaults to nine years before the most recent year with data. |
| `statistic` | string | yes | `"GDP per person"` | Statistic in everyday words, such as GDP per person or inflation. |

## Output

From a run on Oct 23, 2026, shortened. Its input:

```json
{
  "country": "South Korea",
  "statistic": "GDP per person"
}
```

Its output:

```json
{
  "unit": "current US$",
  "source": "World Development Indicators",
  "values": [
    {
      "year": 2016,
      "value": 30832.0628072516
    },
    {
      "year": 2017,
      "value": 33296.9845439195
    },
    {
      "year": 2018,
      "value": 35363.9508228687
    }
  ],
  "country": "Korea, Rep.",
  "statistic": "GDP per capita (current US$)",
  "latest_year": 2025,
  "latest_value": 36226.9663637512,
  "data_page_link": "https://data.worldbank.org/indicator/NY.GDP.PCAP.CD?locations=KR",
  "indicator_code": "NY.GDP.PCAP.CD"
}
```

## Run it

From code, with a Fous API key in `FOUS_API_KEY`; the answer's `data` holds the output:

```bash
curl https://api.fous.com/v1/runs \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"method":"data.worldbank.org/get_country_statistic","input":{"country":"South Korea","statistic":"GDP per person"}}'
```

From an AI agent connected to the Fous MCP server: its `run` with the same method and input. To connect one, give it `set up https://fous.com/SKILL.md`.

## Ask your agent

- What was Brazil's GDP per person over the last ten years, and what is the latest figure?
- Show me inflation rates for Kenya from 2010 to 2020 with the most recent value.
- I need the unemployment rate for Germany for 2015 through 2022, year by year, from worldbank.org.
- What is the latest life expectancy for Japan, plus its annual values since 2000?
- Give me the annual population figures for Nigeria between 2012 and 2023 with a source link.

## Input schema

```json
{
  "type": "object",
  "required": [
    "country",
    "statistic"
  ],
  "properties": {
    "country": {
      "type": "string",
      "minLength": 1,
      "description": "Country name, such as Brazil."
    },
    "to_year": {
      "type": "integer",
      "description": "Last year to include, such as 2023. Defaults to the most recent year with data."
    },
    "from_year": {
      "type": "integer",
      "description": "First year to include, such as 2015. Defaults to nine years before the most recent year with data."
    },
    "statistic": {
      "type": "string",
      "minLength": 1,
      "description": "Statistic in everyday words, such as GDP per person or inflation."
    }
  },
  "additionalProperties": false
}
```

## Output schema

```json
{
  "type": "object",
  "required": [
    "country",
    "statistic",
    "unit",
    "latest_value",
    "latest_year",
    "values",
    "source",
    "data_page_link",
    "indicator_code"
  ],
  "properties": {
    "unit": {
      "type": [
        "string",
        "null"
      ],
      "description": "Unit of measurement."
    },
    "source": {
      "type": "string",
      "description": "World Bank data collection supplying this statistic."
    },
    "values": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "year",
          "value"
        ],
        "properties": {
          "year": {
            "type": "integer"
          },
          "value": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "additionalProperties": false
      },
      "description": "Annual values, oldest first, including years without data."
    },
    "country": {
      "type": "string",
      "description": "World Bank country name."
    },
    "statistic": {
      "type": "string",
      "description": "World Bank indicator title."
    },
    "latest_year": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Year of the most recent available value within the selected years."
    },
    "latest_value": {
      "type": [
        "number",
        "null"
      ],
      "description": "Most recent available value within the selected years."
    },
    "data_page_link": {
      "type": "string",
      "description": "World Bank page for this country and statistic."
    },
    "indicator_code": {
      "type": "string",
      "description": "World Bank indicator identifier.",
      "x-fous-developer": true
    }
  },
  "additionalProperties": false
}
```

## See more

- [World Bank API: Compare countries by a statistic](https://fous.com/methods/worldbank.org/compare-countries.md): 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.
- [Our World in Data API: Get statistic](https://fous.com/methods/ourworldindata.org/get-statistic.md): Finds the Our World in Data chart that best matches a statistic and returns its country-by-year numeric values, definition and source.
- [World Health Organization API: Get country health statistics](https://fous.com/methods/who.int/get-country-health-statistics.md): 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.
- [IMF API: Get economic forecast](https://fous.com/methods/imf.org/get-economic-forecast.md): Gets World Economic Outlook figures for a country or region by year, labelled as actual or forecast. Measures the IMF does not publish for a year are null.
- [European Union API: Get Eurostat statistic for a country](https://fous.com/methods/ec.europa.eu/get-statistic.md): 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.
- [Trading Economics API: Get country economic overview](https://fous.com/methods/tradingeconomics.com/get-country-overview.md): Returns seven key economic indicators for a country from its public Trading Economics overview: GDP growth rate, inflation rate, interest rate, unemployment rate, government debt to GDP, currency and stock market. Indicators absent from the overview are null; the US dollar index is not reported as a USD exchange rate.
- [IMF API: List country rankings](https://fous.com/methods/imf.org/list-country-rankings.md): Ranks countries by a World Economic Outlook indicator for a chosen year, excluding regional and group totals and countries without a value.
- [Trading Economics API: List countries by indicator](https://fous.com/methods/tradingeconomics.com/list-countries-by-indicator.md): 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.
- [All World Bank methods](https://fous.com/methods/worldbank.org.md)
