# Our World in Data API: Get statistic

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

Unofficial. Not affiliated with or endorsed by Our World in Data.

- Page: https://fous.com/methods/ourworldindata.org/get-statistic
- Method: `ourworldindata.org/get_statistic`, version 1
- Website: ourworldindata.org
- Returns: chart title, unit, definition, source, chart link, values by country and year
- 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 |
|---|---|---|---|---|
| `to_year` | integer | no | `2020` | Last year to include. Example: 2020. Defaults to the latest available year. |
| `countries` | string | no | `"France, Germany"` | Country names separated by commas. Example: France, Germany. Defaults to World. Default "World". |
| `from_year` | integer | no | `2018` | First year to include. Example: 2000. Defaults to the earliest available year. |
| `statistic` | string | yes | `"life expectancy"` | The statistic to measure, in plain words. Example: life expectancy. |

## Output

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

```json
{
  "to_year": 2020,
  "countries": "France, Germany",
  "from_year": 2018,
  "statistic": "life expectancy"
}
```

Its output:

```json
{
  "unit": "years",
  "source": "Riley (2005); Zijdeman et al. (2015); HMD (2025); UN WPP (2024) – with major processing by Our World in Data",
  "values": [
    {
      "year": 2018,
      "value": 82.5682,
      "country": "France"
    },
    {
      "year": 2019,
      "value": 82.7304,
      "country": "France"
    },
    {
      "year": 2020,
      "value": 82.1993,
      "country": "France"
    }
  ],
  "chart_link": "https://ourworldindata.org/grapher/life-expectancy",
  "definition": "Period life expectancy is the number of years the average person born in a certain year would live if they experienced the same chances of dying at each age as people did that year.",
  "chart_title": "Life expectancy"
}
```

## 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":"ourworldindata.org/get_statistic","input":{"to_year":2020,"countries":"France, Germany","from_year":2018,"statistic":"life expectancy"}}'
```

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

- Get the yearly CO2 emissions per capita for Japan and South Korea from 1990 to 2015, with the source and definition.
- I need life expectancy at birth for Brazil, Nigeria and India across 1960 through 2019, values by country and year.
- Pull the share of population living in extreme poverty for Kenya between 2000 and 2018, including the chart link.
- What is the global child mortality rate by year up to 2010? Include the unit and data source.
- Show me renewable electricity share of total generation for Germany, Spain and Denmark from 2005 to the latest year available on ourworldindata.org.

## Input schema

```json
{
  "type": "object",
  "required": [
    "statistic"
  ],
  "properties": {
    "to_year": {
      "type": "integer",
      "description": "Last year to include. Example: 2020. Defaults to the latest available year."
    },
    "countries": {
      "type": "string",
      "default": "World",
      "description": "Country names separated by commas. Example: France, Germany. Defaults to World."
    },
    "from_year": {
      "type": "integer",
      "description": "First year to include. Example: 2000. Defaults to the earliest available year."
    },
    "statistic": {
      "type": "string",
      "description": "The statistic to measure, in plain words. Example: life expectancy."
    }
  }
}
```

## Output schema

```json
{
  "type": "object",
  "required": [
    "chart_title",
    "chart_link",
    "values"
  ],
  "properties": {
    "unit": {
      "type": [
        "string",
        "null"
      ]
    },
    "source": {
      "type": [
        "string",
        "null"
      ]
    },
    "values": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer"
          },
          "value": {
            "type": "number"
          },
          "country": {
            "type": "string"
          }
        }
      }
    },
    "chart_link": {
      "type": "string"
    },
    "definition": {
      "type": [
        "string",
        "null"
      ]
    },
    "chart_title": {
      "type": "string"
    }
  }
}
```

## See more

- [World Bank API: Get country statistic](https://fous.com/methods/data.worldbank.org/get-country-statistic.md): Looks up a World Bank statistic for a country and returns its annual values and latest value for the selected years.
- [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.
- [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.
- [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.
- [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.
- [FRED API: Get economic indicator](https://fous.com/methods/fred.stlouisfed.org/get-economic-indicator.md): Gets a public FRED economic series by plain name or series ID, with its observations, latest value and source details.
- [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.
- [Kworb API: Get YouTube music chart](https://fous.com/methods/kworb.net/get-youtube-music-chart.md): Gets Kworb's latest YouTube music chart, worldwide or for one country, ordered by daily views. The worldwide chart covers the past 24 hours. Country charts report daily track streams.
