Endpoint reference ยท v1
Calendar API
Return calendar facts for a date in a timezone.
GET
/api/v1/calendarWhat It Does
Return calendar facts for a date in a timezone.
- HTTP method
- GET
- Authentication
- Public read-only; Bearer keys supported
- Version
- v1
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
date | date | No | Calendar date. Example: 2026-09-09 |
timezone | string | No | IANA timezone. Example: Asia/Karachi |
Request Examples
cURL
curl -s 'https://worldclock.to/api/v1/calendar?date=2026-09-09&timezone=Asia/Karachi'JavaScript
const response = await fetch("https:\/\/worldclock.to\/api\/v1\/calendar?date=2026-09-09&timezone=Asia\/Karachi");
const result = await response.json();
console.log(result.data);PHP
$response = wp_remote_get('https://worldclock.to/api/v1/calendar?date=2026-09-09&timezone=Asia/Karachi');
= json_decode(wp_remote_retrieve_body(), true);Python
import requests
response = requests.get("https:\/\/worldclock.to\/api\/v1\/calendar?date=2026-09-09&timezone=Asia\/Karachi")
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": {
"date": "2026-09-09",
"weekday": "Wednesday",
"iso_week": 37,
"iso_week_year": 2026,
"day_of_year": 252,
"days_in_month": 30,
"leap_year": false,
"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.date | Validated Gregorian date. |
data.weekday | English weekday name. |
data.day_of_year | Ordinal day of year. |
data.iso_week | ISO-8601 week number. |
data.iso_week_year | ISO week-numbering year. |
data.days_in_month | Number of days in the month. |
data.timezone | Timezone used to interpret the calendar date. |
data.leap_year | Whether the Gregorian year is a leap year. |
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.