compare_geographies
Compare a UNESCO UIS indicator across up to 20 specified countries or regions. Retrieves values, ranks them by value, and reports missing codes. Supports strict year or fallback to nearest year.
Instructions
Compare a UNESCO UIS indicator across a specific list of countries or regions.
Retrieves the indicator value for each supplied geo unit code and ranks them by value. Use this to directly compare a set of countries or regions you already know the codes for (e.g. from prior searches or elicitations).
Year handling:
strict_year=True (default): year must be provided; if a geography has no value in that year, it is reported in missing_codes (no fallback year used).
strict_year=False:
year provided: falls back to the nearest available year per geography.
year omitted: uses the most recent available year per geography (mixed years possible).
Args: indicator_code: The indicator code (e.g. "LR.AG15T99"). geo_unit_codes: List of geo unit codes to compare (max 20, e.g. ["KEN", "TZA", "UGA"]). Codes must already be known — use search_geo_units to find them. year: Optional. The year to compare. If omitted, the most recent available value for each geography is used only when strict_year=False. strict_year: If True, require an explicit year and disallow fallback years.
Returns: A dictionary with: - "indicator_code", "indicator_name": Indicator identity. - "comparison": [{rank, code, name, value, year, qualifier}, ...] sorted by value desc. - "missing_codes": Geo unit codes for which no data was found. - "note": Context (e.g. mixed years warning, missing codes).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| indicator_code | Yes | ||
| geo_unit_codes | Yes | ||
| year | No | ||
| strict_year | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||