Retrieve information about administrative subdivisions (states, provinces, territories, prefectures, etc.) as defined by ISO 3166-2.
Standards Used
- ISO 3166-2
- IANA TZDB
- ISO 3166-1
The Region object#
| Field | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | ISO 3166-2 code (e.g., "US-CA"). Example: US-CA |
| code_alt | string | No | Alternative code where ambiguity exists. Example: CA |
| country | string | Yes | Parent country (alpha-2 code). Example: US |
| kind | string | Yes | Subdivision type (e.g., "state", "province", "prefecture"). Example: state |
| name | string | Yes | Region name. Example: California |
| timezone | string | Yes | Primary IANA timezone. Example: America/Los_Angeles |
Endpoints#
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| countryquery | string | No | Filter by country (alpha-2 code) - required. Example: US |
| pagequery | integer | No | Page number (1-indexed). Example: 1 |
| per_pagequery | integer | No | Number of results per page. Example: 20 |
Response
| Field | Type | Required | Description |
|---|---|---|---|
| data | object[] | Yes | The data items for this page. |
| pagination | object | Yes | Pagination metadata in response. |
| page | integer | Yes | Current page number. Example: 1 |
| per_page | integer | Yes | Items per page. Example: 20 |
| total_items | integer | Yes | Total number of items. Example: 100 |
| total_pages | integer | Yes | Total number of pages. Example: 5 |
Example Request
const response = await fetch(
'https://worlddataapi.com/v1/regions?country=US&page=1',
{
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();import requests
response = requests.get(
'https://worlddataapi.com/v1/regions',
params={
'country': 'US',
'page': 'eyJpZCI6MTB9'
},
headers={
'X-API-Key': 'YOUR_API_KEY'
}
)
data = response.json()curl "https://worlddataapi.com/v1/regions?country=US&page=1"
-H "X-API-Key: YOUR_API_KEY"Error Responses
| Status | Description |
|---|---|
| 400 | Missing country parameter |
| 404 | Country not found |
| 429 | Rate limit exceeded |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| identifierpath | string | Yes | ISO 3166-2 region code (e.g., 'US-CA', 'JP-13') |
Response
| Field | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | ISO 3166-2 code (e.g., "US-CA"). Example: US-CA |
| code_alt | string | No | Alternative code where ambiguity exists. Example: CA |
| country | string | Yes | Parent country (alpha-2 code). Example: US |
| kind | string | Yes | Subdivision type (e.g., "state", "province", "prefecture"). Example: state |
| name | string | Yes | Region name. Example: California |
| timezone | string | Yes | Primary IANA timezone. Example: America/Los_Angeles |
Example Request
const response = await fetch(
'https://worlddataapi.com/v1/regions/example',
{
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();import requests
response = requests.get(
'https://worlddataapi.com/v1/regions/example',
headers={
'X-API-Key': 'YOUR_API_KEY'
}
)
data = response.json()curl "https://worlddataapi.com/v1/regions/example"
-H "X-API-Key: YOUR_API_KEY"Error Responses
| Status | Description |
|---|---|
| 404 | Region not found |