Retrieve information about IANA timezones, including UTC offsets and regional associations.
Standards Used
- IANA TZDB
- ISO 3166-1
Path Encoding#
IANA timezone IDs contain slashes (e.g., America/New_York), which is typically not URL-safe. Make sure you URL-encode these identifiers, otherwise our API will most likely return 404 Not Found.
The Timezone object#
| Field | Type | Required | Description |
|---|---|---|---|
| country | string | No | Primary country (alpha-2 code). Example: US |
| id | string | Yes | IANA timezone identifier. Example: America/New_York |
| name | string | Yes | Human-readable name. Example: Eastern Time |
| offset | string | Yes | UTC offset string (e.g., "-05:00"). Example: -05:00 |
| offset_minutes | integer (int32) | Yes | UTC offset in total minutes. Example: -300 |
Endpoints#
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| pagequery | integer | No | Page number (1-indexed). Example: 1 |
| per_pagequery | integer | No | Number of results per page (1-100). 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/timezones?page=1&per_page=20',
{
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();import requests
response = requests.get(
'https://worlddataapi.com/v1/timezones',
params={
'page': 'eyJpZCI6MTB9',
'per_page': 'eyJpZCI6MTB9'
},
headers={
'X-API-Key': 'YOUR_API_KEY'
}
)
data = response.json()curl "https://worlddataapi.com/v1/timezones?page=1&per_page=20"
-H "X-API-Key: YOUR_API_KEY"Error Responses
| Status | Description |
|---|---|
| 429 | Rate limit exceeded |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| identifierpath | string | Yes | IANA timezone ID (e.g., 'America/New_York', 'Europe/London') |
Response
| Field | Type | Required | Description |
|---|---|---|---|
| country | string | No | Primary country (alpha-2 code). Example: US |
| id | string | Yes | IANA timezone identifier. Example: America/New_York |
| name | string | Yes | Human-readable name. Example: Eastern Time |
| offset | string | Yes | UTC offset string (e.g., "-05:00"). Example: -05:00 |
| offset_minutes | integer (int32) | Yes | UTC offset in total minutes. Example: -300 |
Example Request
const response = await fetch(
'https://worlddataapi.com/v1/timezones/example',
{
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();import requests
response = requests.get(
'https://worlddataapi.com/v1/timezones/example',
headers={
'X-API-Key': 'YOUR_API_KEY'
}
)
data = response.json()curl "https://worlddataapi.com/v1/timezones/example"
-H "X-API-Key: YOUR_API_KEY"Error Responses
| Status | Description |
|---|---|
| 404 | Timezone not found |