curl -X GET 'https://api.countrystatecity.in/v1/iso/country?iso2=US' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
curl -X GET 'https://api.countrystatecity.in/v1/iso/country?iso3=IND' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
curl -X GET 'https://api.countrystatecity.in/v1/iso/country?numeric=840' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
const response = await fetch(
'https://api.countrystatecity.in/v1/iso/country?iso2=US',
{ headers: { 'X-CSCAPI-KEY': 'YOUR_API_KEY' } }
);
const country = await response.json();
console.log(`${country.name} (id ${country.id})`);
import requests
response = requests.get(
'https://api.countrystatecity.in/v1/iso/country',
params={'iso3': 'USA'},
headers={'X-CSCAPI-KEY': 'YOUR_API_KEY'}
)
country = response.json()
print(f"{country['name']} → numeric {country['numeric_code']}")
{
"id": 233,
"name": "United States",
"iso2": "US",
"iso3": "USA",
"numeric_code": "840"
}
{
"status": "error",
"message": "Invalid query parameters: Provide exactly one of: iso2, iso3, numeric"
}
{
"status": "error",
"message": "Invalid query parameters: iso2: must be a 2-letter code"
}
{
"status": "error",
"message": "This feature is not available on your current plan.",
"details": {
"feature": "isoLookup",
"currentTier": "community",
"requiredTier": "starter",
"upgradeUrl": "https://app.countrystatecity.in/pricing"
}
}
{
"status": "error",
"message": "Country not found for the given code"
}
ISO Codes
Lookup Country by ISO Code
Find a country by ISO 3166-1 alpha-2, alpha-3, or numeric code
GET
/
iso
/
country
curl -X GET 'https://api.countrystatecity.in/v1/iso/country?iso2=US' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
curl -X GET 'https://api.countrystatecity.in/v1/iso/country?iso3=IND' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
curl -X GET 'https://api.countrystatecity.in/v1/iso/country?numeric=840' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
const response = await fetch(
'https://api.countrystatecity.in/v1/iso/country?iso2=US',
{ headers: { 'X-CSCAPI-KEY': 'YOUR_API_KEY' } }
);
const country = await response.json();
console.log(`${country.name} (id ${country.id})`);
import requests
response = requests.get(
'https://api.countrystatecity.in/v1/iso/country',
params={'iso3': 'USA'},
headers={'X-CSCAPI-KEY': 'YOUR_API_KEY'}
)
country = response.json()
print(f"{country['name']} → numeric {country['numeric_code']}")
{
"id": 233,
"name": "United States",
"iso2": "US",
"iso3": "USA",
"numeric_code": "840"
}
{
"status": "error",
"message": "Invalid query parameters: Provide exactly one of: iso2, iso3, numeric"
}
{
"status": "error",
"message": "Invalid query parameters: iso2: must be a 2-letter code"
}
{
"status": "error",
"message": "This feature is not available on your current plan.",
"details": {
"feature": "isoLookup",
"currentTier": "community",
"requiredTier": "starter",
"upgradeUrl": "https://app.countrystatecity.in/pricing"
}
}
{
"status": "error",
"message": "Country not found for the given code"
}
Look up a single country by any one of the three ISO 3166-1 codes: 2-letter (alpha-2), 3-letter (alpha-3), or 3-digit numeric. Exactly one query parameter must be provided.
This is the canonical lookup when you have an ISO code from an external system (payment gateway, geolocation service, address parser) and need to resolve it to the country record.
Availability: Starter plan and above. Returns
403 on Community plan.Responses are cached server-side for 1 hour. The cache slot is shared with
/v1/iso/country/convert — warming the cache via one endpoint serves the other for free. Numeric codes 4 and 004 resolve to the same cache slot.Query Parameters
Provide exactly one of the three. Sending two or zero returns400.
curl -X GET 'https://api.countrystatecity.in/v1/iso/country?iso2=US' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
curl -X GET 'https://api.countrystatecity.in/v1/iso/country?iso3=IND' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
curl -X GET 'https://api.countrystatecity.in/v1/iso/country?numeric=840' \
-H 'X-CSCAPI-KEY: YOUR_API_KEY'
const response = await fetch(
'https://api.countrystatecity.in/v1/iso/country?iso2=US',
{ headers: { 'X-CSCAPI-KEY': 'YOUR_API_KEY' } }
);
const country = await response.json();
console.log(`${country.name} (id ${country.id})`);
import requests
response = requests.get(
'https://api.countrystatecity.in/v1/iso/country',
params={'iso3': 'USA'},
headers={'X-CSCAPI-KEY': 'YOUR_API_KEY'}
)
country = response.json()
print(f"{country['name']} → numeric {country['numeric_code']}")
{
"id": 233,
"name": "United States",
"iso2": "US",
"iso3": "USA",
"numeric_code": "840"
}
{
"status": "error",
"message": "Invalid query parameters: Provide exactly one of: iso2, iso3, numeric"
}
{
"status": "error",
"message": "Invalid query parameters: iso2: must be a 2-letter code"
}
{
"status": "error",
"message": "This feature is not available on your current plan.",
"details": {
"feature": "isoLookup",
"currentTier": "community",
"requiredTier": "starter",
"upgradeUrl": "https://app.countrystatecity.in/pricing"
}
}
{
"status": "error",
"message": "Country not found for the given code"
}
Related Endpoints
- Lookup State by ISO Code — same idea for ISO 3166-2 subdivision codes
- Convert ISO Code — translate between alpha-2, alpha-3, and numeric in one call
- Get Country Details — full country record (all fields, tier-gated)
Authorizations
API key for authentication. Get your free key at app.countrystatecity.in.
Query Parameters
ISO 3166-1 alpha-2 code (e.g., US). Provide exactly one of iso2, iso3, or numeric.
Example:
"US"
ISO 3166-1 alpha-3 code (e.g., USA). Provide exactly one of iso2, iso3, or numeric.
Example:
"USA"
ISO 3166-1 numeric code, 1–3 digits (e.g., 840). Provide exactly one of iso2, iso3, or numeric.
Example:
"840"
Response
Country record with all ISO identifiers
Country record returned by the ISO lookup endpoint.
Internal CSC country ID
Example:
233
Official English country name
Example:
"United States"
ISO 3166-1 alpha-2 code
Example:
"US"
ISO 3166-1 alpha-3 code
Example:
"USA"
Zero-padded 3-digit ISO 3166-1 numeric code
Example:
"840"