curl -X GET 'https://api.countrystatecity.in/v1/phone' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
curl -X GET 'https://api.countrystatecity.in/v1/phone?code=%2B1' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
curl -X GET 'https://api.countrystatecity.in/v1/phone?code=91' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
const response = await fetch(
'https://api.countrystatecity.in/v1/phone?code=' + encodeURIComponent('+44'),
{ headers: { 'X-CSCAPI-KEY': 'YOUR_API_KEY' } }
);
const entries = await response.json();
// entries: [{ country: "GB", dial_code: "+44", iso2: "GB", iso3: "GBR" }, ...]
import requests
response = requests.get(
'https://api.countrystatecity.in/v1/phone',
params={'code': '+1'},
headers={'X-CSCAPI-KEY': 'YOUR_API_KEY'}
)
nanp_countries = response.json()
print(f"{len(nanp_countries)} countries share +1")
[
{ "country": "AG", "dial_code": "+1", "area_code": "268", "iso2": "AG", "iso3": "ATG" },
{ "country": "AI", "dial_code": "+1", "area_code": "264", "iso2": "AI", "iso3": "AIA" },
{ "country": "BB", "dial_code": "+1", "area_code": "246", "iso2": "BB", "iso3": "BRB" },
{ "country": "BS", "dial_code": "+1", "area_code": "242", "iso2": "BS", "iso3": "BHS" },
{ "country": "CA", "dial_code": "+1", "iso2": "CA", "iso3": "CAN" },
{ "country": "US", "dial_code": "+1", "iso2": "US", "iso3": "USA" }
]
[
{ "country": "IN", "dial_code": "+91", "iso2": "IN", "iso3": "IND" }
]
{
"error": "Invalid dial code. Provide a non-empty value (e.g., +1, 44)."
}
{
"error": "Invalid dial code format. Expected digits (e.g., 91, 1, 44)."
}
{
"error": "This feature is not available on your current plan.",
"feature": "phoneDialCode",
"upgradeUrl": "https://app.countrystatecity.in/pricing"
}
Phone Endpoints
List Dial Codes
List every countryโs international dial code, with optional reverse lookup by dial code
GET
/
v1
/
phone
curl -X GET 'https://api.countrystatecity.in/v1/phone' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
curl -X GET 'https://api.countrystatecity.in/v1/phone?code=%2B1' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
curl -X GET 'https://api.countrystatecity.in/v1/phone?code=91' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
const response = await fetch(
'https://api.countrystatecity.in/v1/phone?code=' + encodeURIComponent('+44'),
{ headers: { 'X-CSCAPI-KEY': 'YOUR_API_KEY' } }
);
const entries = await response.json();
// entries: [{ country: "GB", dial_code: "+44", iso2: "GB", iso3: "GBR" }, ...]
import requests
response = requests.get(
'https://api.countrystatecity.in/v1/phone',
params={'code': '+1'},
headers={'X-CSCAPI-KEY': 'YOUR_API_KEY'}
)
nanp_countries = response.json()
print(f"{len(nanp_countries)} countries share +1")
[
{ "country": "AG", "dial_code": "+1", "area_code": "268", "iso2": "AG", "iso3": "ATG" },
{ "country": "AI", "dial_code": "+1", "area_code": "264", "iso2": "AI", "iso3": "AIA" },
{ "country": "BB", "dial_code": "+1", "area_code": "246", "iso2": "BB", "iso3": "BRB" },
{ "country": "BS", "dial_code": "+1", "area_code": "242", "iso2": "BS", "iso3": "BHS" },
{ "country": "CA", "dial_code": "+1", "iso2": "CA", "iso3": "CAN" },
{ "country": "US", "dial_code": "+1", "iso2": "US", "iso3": "USA" }
]
[
{ "country": "IN", "dial_code": "+91", "iso2": "IN", "iso3": "IND" }
]
{
"error": "Invalid dial code. Provide a non-empty value (e.g., +1, 44)."
}
{
"error": "Invalid dial code format. Expected digits (e.g., 91, 1, 44)."
}
{
"error": "This feature is not available on your current plan.",
"feature": "phoneDialCode",
"upgradeUrl": "https://app.countrystatecity.in/pricing"
}
Return every countryโs international dial code in one call, or do the reverse โ find every country that shares a given dial code (useful for NANP
+1 countries like the US and Canada).
Dial codes follow ITU-T E.164 and are returned with a leading +. For NANP countries with an area-code prefix in the underlying data (e.g. Barbados as +1-246), the area code is returned as a separate area_code field.
Availability: Supporter plan and above. Returns
403 on lower tiers.Responses are cached server-side for 24 hours. Equivalent dial-code inputs (
+91, 91, 091, 0091) all resolve to the same cache slot.Authentication
string
required
Your API key for authentication
Query Parameters
string
Optional. Restrict the response to countries with the given dial code. Accepts:
- With or without leading
+(+91or91) - 1โ4 digits
- Leading zeros are stripped (so
01,001,1all match+1) - NANP area-code variants โ
?code=+1returns the US, Canada, and every NANP territory in one response
Response
The response is an array of phone entries, even when the result is a single country.string
ISO 3166-1 alpha-2 code of the country (e.g.
"US"). Convenience field equal to iso2.string
Dial code with leading
+ (e.g. "+91").string
Present only for NANP entries with a fixed area-code prefix in the underlying data (e.g.
"246" for Barbados). Omitted when not applicable โ do not assume the field exists.string
ISO 3166-1 alpha-2 code (e.g.
"US").string
ISO 3166-1 alpha-3 code (e.g.
"USA").curl -X GET 'https://api.countrystatecity.in/v1/phone' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
curl -X GET 'https://api.countrystatecity.in/v1/phone?code=%2B1' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
curl -X GET 'https://api.countrystatecity.in/v1/phone?code=91' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
const response = await fetch(
'https://api.countrystatecity.in/v1/phone?code=' + encodeURIComponent('+44'),
{ headers: { 'X-CSCAPI-KEY': 'YOUR_API_KEY' } }
);
const entries = await response.json();
// entries: [{ country: "GB", dial_code: "+44", iso2: "GB", iso3: "GBR" }, ...]
import requests
response = requests.get(
'https://api.countrystatecity.in/v1/phone',
params={'code': '+1'},
headers={'X-CSCAPI-KEY': 'YOUR_API_KEY'}
)
nanp_countries = response.json()
print(f"{len(nanp_countries)} countries share +1")
[
{ "country": "AG", "dial_code": "+1", "area_code": "268", "iso2": "AG", "iso3": "ATG" },
{ "country": "AI", "dial_code": "+1", "area_code": "264", "iso2": "AI", "iso3": "AIA" },
{ "country": "BB", "dial_code": "+1", "area_code": "246", "iso2": "BB", "iso3": "BRB" },
{ "country": "BS", "dial_code": "+1", "area_code": "242", "iso2": "BS", "iso3": "BHS" },
{ "country": "CA", "dial_code": "+1", "iso2": "CA", "iso3": "CAN" },
{ "country": "US", "dial_code": "+1", "iso2": "US", "iso3": "USA" }
]
[
{ "country": "IN", "dial_code": "+91", "iso2": "IN", "iso3": "IND" }
]
{
"error": "Invalid dial code. Provide a non-empty value (e.g., +1, 44)."
}
{
"error": "Invalid dial code format. Expected digits (e.g., 91, 1, 44)."
}
{
"error": "This feature is not available on your current plan.",
"feature": "phoneDialCode",
"upgradeUrl": "https://app.countrystatecity.in/pricing"
}
Related Endpoints
- Get Dial Code by Country โ one country at a time when you already know the country
- Parse Phone Number โ given an E.164 number, identify the country
Was this page helpful?
โI