Compare Countries
compare_countriesCompare a World Bank indicator across MULTIPLE countries in one call, returned ranked high→low. PREFER for "GDP per capita: US vs China vs Germany", "rank the G7 by CO2 emissions", "compare population of ". Pass 2+ ISO country codes. Defaults to each country's most-recent available value; pass a year for a specific year. Common indicators: NY.GDP.MKTP.CD (GDP), NY.GDP.PCAP.CD (GDP per capita), SP.POP.TOTL (population), EN.GHG.CO2.MT.CE.AR5 (CO2, Mt), FP.CPI.TOTL.ZG (inflation %). For CO2 rankings prefer country_co2_emissions, which knows the right series.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | No | Optional 4-digit year (e.g. "2023"). Omit for each country's most-recent available value. | |
| indicator | Yes | World Bank indicator code (e.g. "NY.GDP.PCAP.CD", "SP.POP.TOTL", "EN.GHG.CO2.MT.CE.AR5"). | |
| country_codes | Yes | 2+ ISO country codes, comma- or semicolon-separated (e.g. "US,CN,DE" or "USA;CHN;DEU"). |