Skip to main content
GET
Convert a country code between the three ISO 3166-1 formats in a single call:
  • alpha-2 ↔ alpha-3 (e.g. US ↔ USA)
  • alpha-2 ↔ numeric (e.g. US ↔ 840)
  • alpha-3 ↔ numeric (e.g. USA ↔ 840)
Useful when an upstream system gives you one format and a downstream service expects another.
Availability: Starter plan and above. Returns 403 on Community plan.
Cache reuse: Conversions share the same cache slot as /v1/iso/country. A previous ?iso2=US lookup serves any ?from=iso2&value=US&to=... conversion without a fresh database hit. The target column is extracted after the cache read, so different to values reuse the same slot.Numeric inputs 4 and 004 resolve to the same cache slot.

Authorizations

X-CSCAPI-KEY
string
header
required

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

Query Parameters

from
enum<string>
required

Source format

Available options:
iso2,
iso3,
numeric
Example:

"iso2"

to
enum<string>
required

Target format (must differ from from)

Available options:
iso2,
iso3,
numeric
Example:

"iso3"

value
string
required

The code to convert (e.g., US when from=iso2)

Example:

"US"

Response

Converted ISO code

Result of an ISO 3166-1 code conversion.

from
enum<string>
required

Source format

Available options:
iso2,
iso3,
numeric
Example:

"iso2"

to
enum<string>
required

Target format

Available options:
iso2,
iso3,
numeric
Example:

"iso3"

input
string
required

The input code, echoed back from the value query parameter

Example:

"US"

result
string
required

The converted code. Numeric results are zero-padded to 3 digits.

Example:

"USA"