Browse

Country Calling Codes

Looks up a country by calling code (+44), ISO region (GB) or English country name and returns the calling code, every region that shares it, national number lengths, trunk and international dialing prefixes, example numbers and the leading digits of mobile and fixed-line numbers where the numbering plan defines them. Derived from open libphonenumber metadata and CLDR country names; it describes numbering-plan rules, not who is assigned a number.

POST https://YOUR_API_HOST/v1/country-code

Credits and caching

  • Success billing. 1 credit per lookup (an unknown code, country or name is free). You are charged only when the lookup finds something; a not-found result is free.
  • Results are cached per account for 7 days. Repeating the same lookup in that window is free and returns cache_hit: true.
  • Invalid input, rate limits and errors are never charged.
  • Read the billing rules for the full picture.

Request

Send a JSON body with Authorization: Bearer <key>. The body can be up to 64 KB.

FieldTypeRequiredNotes
querystringyesUp to 64 characters.

Example request

Terminal
curl -X POST https://YOUR_API_HOST/v1/country-code \
  -H "Authorization: Bearer $LOOKVALID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"+44"}'

Response

The status is 200 whether or not anything was found. Check found. Every response also carries the X-Request-Id, X-Credits-Charged, X-Credits-Remaining and X-RateLimit-* headers.

Envelope

FieldTypeNotes
request_idstring-
product"country-code"-
foundbooleanFalse means the lookup ran and found nothing; it is free.
reasonstring or nullWhy nothing was found; null when found.
sourcesarray of stringWhere the data came from, including any attribution the licence requires.
credits_chargedinteger0 for a cache hit, a not-found result or an error.
credits_remaininginteger-
cache_hitbooleanTrue when the account already paid for this lookup within the cache window.
cacheobject-

The data object

Present when found is true, otherwise null.

_No fields._

Captured example (2026-10-18)

A real run of this lookup on 2026-10-18, using the request above, which is a public input. The envelope fields are left out.

{
  "product": "country-code",
  "found": true,
  "data": {
    "kind": "calling_code",
    "calling_code": "44",
    "non_geographic": false,
    "shared": true,
    "main_region": "GB",
    "regions": [
      {
        "region": "GB",
        "name": "United Kingdom",
        "region_leading_digits_pattern": null
      },
      {
        "region": "GG",
        "name": "Guernsey",
        "region_leading_digits_pattern": null
      },
      {
        "region": "IM",
        "name": "Isle of Man",
        "region_leading_digits_pattern": "74576|(?:16|7[56])24"
      },
      {
        "region": "JE",
        "name": "Jersey",
        "region_leading_digits_pattern": null
      }
    ],
    "numbering": null,
    "notes": "Several regions share this calling code and are told apart by their number patterns, not by the code. main_region is the metadata default where shared formats are stored, not a political ranking."
  },
  "sources": [
    "Google libphonenumber metadata (Apache-2.0) via libphonenumber-js 1.13.15 (MIT)",
    "Country names from Unicode CLDR through Intl.DisplayNames (Unicode License 3.0)"
  ]
}

Errors

  • 400 invalid_input: The request input is invalid.
  • 401 unauthorized: The API key is missing, malformed, revoked or unknown.
  • 402 insufficient_credits: The account does not have enough credits for this lookup. Error code: insufficient_credits. During a trial whose allowance is used up the code is trial_allowance_exhausted: nothing is charged and the customer starts the plan from the billing page.
  • 405 method_not_allowed: This endpoint does not accept that HTTP method.
  • 413 payload_too_large: The request body is too large.
  • 429 rate_limited: Too many requests for this API key.
  • 500 internal_error: An unexpected error occurred.
  • 503 provider_unavailable: The data source for this product is unavailable right now.