Normalize a country code
normalize_country_codeResolve country names, endonyms, aliases, and 2/3-letter codes to ISO 3166-1 alpha-2 country codes. Matches case-, accent-, and punctuation-insensitively.
Instructions
Resolve a country name or code to its ISO 3166-1 alpha-2 code.
Accepts English names, common local-language endonyms (Deutschland,
España, Nippon), everyday aliases (UK, USA, Holland, UAE), and existing
2- or 3-letter codes. Matching is case-, accent-, and punctuation-
insensitive.
Args:
country_name_or_code: The country name, alias, or code to resolve.
Returns a ``{"country_code": "DE"}`` object, or ``{"error": ...}`` when
the input matches no known country.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| country_name_or_code | Yes | A country name, endonym, alias, or 2/3-letter code, e.g. 'Deutschland', 'UK', 'U.S.A.', 'DEU'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||