Get a country statistic
get_country_indicatorUse this when the user asks for one official statistic for one country, such as "what is Vietnam's population?" or "what was unemployment in Spain in 2022?". Pass the country (name or ISO code), the indicator (population, gdp, gdp_per_capita, gdp_growth, inflation, unemployment, life_expectancy, fertility_rate, urban_population, internet_users, exports, gini, co2_per_capita, electricity_use) and optionally a year. Returns the value, its year and unit, the source and the date it was last updated; without a year it returns the latest year with data. It reads annual World Bank statistics only: no live data, forecasts or regions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | No | A specific calendar year; leave out for the latest year with data | |
| country | Yes | A country name or ISO code, such as "Vietnam", "VN" or "VNM" | |
| indicator | Yes | population, gdp, gdp_per_capita, gdp_growth, inflation, unemployment, life_expectancy and the other listed series |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | ||
| as_of | Yes | ISO 8601 time the data was published by its source or fetched from it. A cached answer keeps the time of its fetch. | |
| value | Yes | ||
| notice | Yes | ||
| source | Yes | Who the data comes from, to cite and to check it against. | |
| status | Yes | ||
| country | Yes | ||
| message | No | ||
| indicator | Yes |