Skip to main content
GET
Given a phone number in E.164 format (+ followed by country code and national digits), identify the originating country and split out the national portion. The matcher walks 3-digit β†’ 2-digit β†’ 1-digit ITU prefixes, so longer-prefix countries (like +972 Israel) win over shorter-prefix ones that share the leading digit. For NANP +1 numbers, the area code is matched against known territory area codes β€” +1-246-555-1234 resolves to Barbados (BB), not the US.
Availability: Starter plan and above. Returns 403 on lower tiers.
The response echoes the phone number (e164 and national_number), so it’s PII. The endpoint returns Cache-Control: no-store and emits no ETag β€” Cloudflare, browsers, and intermediate proxies will not retain the response. Do not change this if you’re proxying through additional caching layers; the Cache-Control is intentional.The internal phone-prefix index is cached server-side for 24 hours. The X-Parse-Index-Cache: HIT|MISS header reports whether that internal lookup was a cache hit β€” it does not describe the response body.

Notes on Matching

The matcher tries 3-digit, then 2-digit, then 1-digit ITU prefixes:
  • +972... matches Israel (3-digit prefix), not Yemen (+967) or any 1-digit +9 country (none exist, but the logic generalizes).
  • +44... matches the UK (2-digit prefix).
  • +1... is the NANP β€” the next 3 digits are checked against known area codes (Barbados 246, Antigua 268, etc.). If no area code matches, the request falls back to the US.
When the data carries a +1-XXX area-code prefix for a country, the matcher prefers that more-specific entry over the bare +1.

Authorizations

X-CSCAPI-KEY
string
header
required

API key for authentication. Get your free key at app.countrystatecity.in.

Query Parameters

number
string
required

E.164-formatted phone number β€” + followed by 5–15 digits (e.g., +14155552671)

Example:

"+14155552671"

Response

Parsed phone number with country identification

Result of parsing an E.164 phone number. Contains PII (the echoed phone number) β€” the endpoint returns Cache-Control: no-store.

country
string
required

ISO 3166-1 alpha-2 code of the originating country

Example:

"US"

dial_code
string
required

Country dial code with + prefix

Example:

"+1"

iso2
string
required

ISO 3166-1 alpha-2 code

Example:

"US"

iso3
string
required

ISO 3166-1 alpha-3 code

Example:

"USA"

national_number
string
required

Digits after removing the country code

Example:

"4155552671"

e164
string
required

Normalized input echoed back

Example:

"+14155552671"

area_code
string | null

Area code for NANP territories only

Example:

null