# Country Code Converter (ISO 3166-1 alpha-2/alpha-3/numeric + metadata)

> Country Code Converter (ISO 3166-1 alpha-2/alpha-3/numeric + metadata) is a paid API for AI agents from country-codes-iso.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-30).

Converts a country code between ISO 3166-1 alpha-2, alpha-3, and numeric forms, and returns associated metadata including country name, currency, ccTLD, and calling code.

## Facts

- Endpoint: GET https://country-codes-iso.x402tookit.com/code-convert?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/country-code-converter-iso-3166-1-alpha-2-alpha-3-numeric-metadata-5e72e405
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_yitsvgje63SAqX1Wqv_G-

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability country-code-converter-iso-3166-1-alpha-2-alpha-3-numeric-metadata-5e72e405
```

Example prompt: Can you convert the country code 'DEU' and give me back the alpha-2 code, numeric code, currency, ccTLD, and calling code for that country?

## When to prefer this

Use this endpoint when you need to convert between ISO 3166-1 code formats (alpha-2 ↔ alpha-3 ↔ numeric) or retrieve standard country metadata like currency, ccTLD, or calling code from a known ISO code. Prefer this over the fuzzy-match or name-normalization sibling endpoints when you already have a valid ISO code and need a precise, structured conversion rather than name resolution or search.

## Known failure modes

- Invalid or unrecognized country code returns a non-match or error result
- Ambiguous numeric codes may resolve to unexpected countries if input format is unclear
- Payment failure (402) if USDC balance is insufficient
- Rate limiting or service unavailability returning 5xx errors
- Deleted or reserved ISO codes may return degraded or partial results

## How this service works

Convert an ISO 3166-1 country code between alpha-2, alpha-3 and numeric; also name, currency, ccTLD, calling code.

## Output

Returns a structured object containing the matched country's alpha-2, alpha-3, and numeric codes, official and common name, currency code(s), ccTLD, calling code(s), region, sub-region, capital, and independence status. A summary and attribution are also included. The `to` parameter lets you filter down to only the specific field type you need.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "code"
     ],
     "properties": {
      "to": {
       "type": "string",
       "description": "Target: all (default), alpha2, alpha3, numeric, name, currency, tld or calling"
      },
      "code": {
       "type": "string",
       "description": "Country code in any form: US, USA or 840"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "to": {
       "type": [
        "null",
        "string"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "from": {
       "type": [
        "null",
        "string"
       ]
      },
      "input": {
       "type": [
        "null",
        "string"
       ]
      },
      "result": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "name": {
         "type": [
          "null",
          "string"
         ]
        },
        "alpha2": {
         "type": [
          "null",
          "string"
         ]
        },
        "alpha3": {
         "type": [
          "null",
          "string"
         ]
        },
        "numeric": {
         "type": [
          "null",
          "string"
         ]
        }
       }
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "country": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "tld": {
         "type": [
          "null",
          "string"
         ]
        },
        "name": {
         "type": [
          "null",
          "string"
         ]
        },
        "alpha2": {
         "type": [
          "null",
          "string"
         ]
        },
        "alpha3": {
         "type": [
          "null",
          "string"
         ]
        },
        "region": {
         "type": [
          "null",
          "string"
         ]
  
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/country-code-converter-iso-3166-1-alpha-2-alpha-3-numeric-metadata-5e72e405/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from country-codes-iso.x402tookit.com](https://www.zero.xyz/host/country-codes-iso.x402tookit.com/llms.txt)
