get_country_metric
Retrieve a single country's GDP, population, or GDP per capita by ISO code or name for a given or latest year, with optional currency conversion.
Instructions
One country's gdp, population, or gdp_per_capita for a year.
country: ISO2/ISO3 code or a name from either source ("France", "FR", "FRA", "Czechia").
metric: gdp | population | gdp_per_capita (GDP divided by population, same year).
year: a year like "2022", or "latest" (walks back past null years and reports year_used).
currency: any Frankfurter-supported currency (GDP is natively current US$).
fx_date: "YYYY-MM-DD" or "latest". Default: year-end of a pinned year (falls back to the last trading day, e.g. 2022 -> 2022-12-30), or the latest rate when year='latest'. The response includes the exact year used, FX rate and date, flags, and sources.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | No | latest | |
| metric | No | gdp | |
| country | Yes | ||
| fx_date | No | ||
| currency | No | USD |