Parse an E.164 phone number into its country and national parts
Given a phone number in E.164 format (Documentation Index
Fetch the complete documentation index at: https://docs.countrystatecity.in/llms.txt
Use this file to discover all available pages before exploring further.
+ 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.
403 on lower tiers.+ followed by 5–15 digits.Both +14155552671 and the URL-decoded form 14155552671 (with a leading space, which is how some HTTP clients deliver an unencoded +) are accepted."BB"). Convenience field equal to iso2.+ (e.g. "+1")."246" for Barbados). Omitted when not applicable.+, no separators). For NANP numbers this includes the area code — the area code is part of the national format.+).+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.+1-XXX area-code prefix for a country, the matcher prefers that more-specific entry over the bare +1.