Skip to content
Endpoint reference · v1

Country API

Return country, capital, geographic region, timezones and bundled cities.

GET/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
curl -s 'https://worldclock.to/api/v1/country/pakistan'
JavaScript
const response = await fetch("https:\/\/worldclock.to\/api\/v1\/country\/pakistan");
const result = await response.json();
console.log(result.data);
PHP
$response = wp_remote_get('https://worldclock.to/api/v1/country/pakistan');
 = json_decode(wp_remote_retrieve_body(), true);
Python
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.

JSON
{
    "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.

PropertyMeaning
successBoolean indicating whether the request completed successfully.
meta.versionPublished API response version.
meta.timestampUnix timestamp for the API response instant.
meta.timezoneTimezone context used by the response.
meta.rate_limitPer-client fair-use limit and remaining-request information on public transports.
data.nameCountry or territory name.
data.slugStable country slug.
data.codeTwo-letter country code.
data.capitalBundled capital city.
data.regionBroad geographic region stored for the country.
data.timezonesTimezone objects with label, offset, abbreviation, DST state and current time.
data.timezones[].timezoneIANA timezone identifier.
data.timezones[].labelHuman-readable timezone label.
data.timezones[].utc_offsetCurrent UTC offset.
data.timezones[].abbreviationCurrent timezone abbreviation.
data.timezones[].dstCurrent DST state.
data.timezones[].current_timeCurrent local ISO 8601 time.
data.citiesBundled WorldClock city objects belonging to the country.
data.cities[].nameCity display name.
data.cities[].slugCity slug.
data.cities[].latitudeDecimal latitude.
data.cities[].longitudeDecimal longitude.
data.cities[].timezoneIANA 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.

Related Endpoints