Country API
Return country, capital, geographic region, timezones and bundled cities.
/api/v1/country/{country}What It Does
Return country, capital, geographic region, timezones and bundled cities.
- HTTP method
- GET
- Authentication
- Public read-only; Bearer keys supported
- Version
- v1
Parameters
Path parameter: country — required country slug, for example pakistan.
This endpoint has no query parameters beyond the path value shown above.
Request Examples
curl -s 'https://worldclock.to/api/v1/country/pakistan'const response = await fetch("https:\/\/worldclock.to\/api\/v1\/country\/pakistan");
const result = await response.json();
console.log(result.data);$response = wp_remote_get('https://worldclock.to/api/v1/country/pakistan');
= json_decode(wp_remote_retrieve_body(), true);import requests
response = requests.get("https:\/\/worldclock.to\/api\/v1\/country\/pakistan")
response.raise_for_status()
print(response.json()["data"])Example Response
The values below illustrate the response shape. Live current-time fields are generated dynamically by the endpoint.
{
"success": true,
"data": {
"name": "Pakistan",
"slug": "pakistan",
"code": "PK",
"capital": "Islamabad",
"region": "Asia",
"timezones": [
{
"timezone": "Asia/Karachi",
"label": "Pakistan Standard Time",
"utc_offset": "+05:00",
"abbreviation": "PKT",
"dst": false,
"current_time": "2026-09-09T14:30:00+05:00"
}
],
"cities": [
{
"name": "Karachi",
"slug": "karachi",
"latitude": 24.8599999999999994315658113919198513031005859375,
"longitude": 67.0100000000000051159076974727213382720947265625,
"timezone": "Asia/Karachi"
}
]
},
"meta": {
"version": "v1",
"timestamp": 1788946200
}
}Response Properties
Every successful response contains success: true, endpoint-specific data, and a meta object. The table below documents the public fields for this endpoint.
| Property | Meaning |
|---|---|
success | Boolean indicating whether the request completed successfully. |
meta.version | Published API response version. |
meta.timestamp | Unix timestamp for the API response instant. |
meta.timezone | Timezone context used by the response. |
meta.rate_limit | Per-client fair-use limit and remaining-request information on public transports. |
data.name | Country or territory name. |
data.slug | Stable country slug. |
data.code | Two-letter country code. |
data.capital | Bundled capital city. |
data.region | Broad geographic region stored for the country. |
data.timezones | Timezone objects with label, offset, abbreviation, DST state and current time. |
data.timezones[].timezone | IANA timezone identifier. |
data.timezones[].label | Human-readable timezone label. |
data.timezones[].utc_offset | Current UTC offset. |
data.timezones[].abbreviation | Current timezone abbreviation. |
data.timezones[].dst | Current DST state. |
data.timezones[].current_time | Current local ISO 8601 time. |
data.cities | Bundled WorldClock city objects belonging to the country. |
data.cities[].name | City display name. |
data.cities[].slug | City slug. |
data.cities[].latitude | Decimal latitude. |
data.cities[].longitude | Decimal longitude. |
data.cities[].timezone | IANA timezone identifier. |
Errors use success: false with a stable machine-readable error code and a safe human-readable message.
Errors & HTTP Status Codes
400— invalid or missing parameter.401— API key required or invalid when key-only access is enabled.404— unknown city, country or endpoint.429— configured rate limit reached.503— API disabled or maintenance mode.
Rate Limits & Caching
Current fair-use configuration is 60 requests per minute and 5000 requests per day. Cache stable directory/calculation responses where appropriate; treat current-time output as point-in-time data.