Skip to main content
GET
Resolve an ISO 3166-2 subdivision code (e.g. US-CA, IN-MH, DE-BY) to the state/province record. The match prefers the canonical iso3166_2 column. When that column is NULL for a row (common in older imports), the endpoint falls back to matching the legacy iso2 column scoped to the same country โ€” so the lookup works even for partially-coded rows without risking cross-country false matches.
Availability: Starter plan and above. Returns 403 on Community plan.
Responses are cached server-side for 1 hour. The lookup key is the full ISO 3166-2 code, so US-CA and us-ca collapse to the same cache slot (input is auto-uppercased).

Authentication

string
required
Your API key for authentication

Query Parameters

string
required
ISO 3166-2 subdivision code in the form XX-YYY โ€” 2-letter country code, hyphen, then 1โ€“3 alphanumeric characters for the subdivision. Case-insensitive (auto-uppercased).Examples: US-CA, IN-MH, DE-BY, GB-ENG, JP-13

Response

integer
Internal CSC state ID โ€” same value used by /v1/states/:id and as a foreign key from /cities.
string
Official state/province name in English (e.g. "California").
string | null
Legacy subdivision code without the country prefix (e.g. "CA"). May be null for some entries.
string | null
Canonical ISO 3166-2 code (e.g. "US-CA"). May be null for older entries โ€” the endpoint still resolves them via the iso2 fallback.
integer
Internal CSC country ID โ€” foreign key into /countries.
string
ISO 3166-1 alpha-2 code of the parent country (e.g. "US").