Skip to content

REST API Overview

Base URL

https://mycal-api.huijun00100101.workers.dev/v1

All responses are JSON. CORS is open (Access-Control-Allow-Origin: *), so you can call the API directly from the browser.

Authentication

None required. Every public endpoint is readable without an API key.

Rate limits

100 requests per minute per IP. Exceeding the limit returns HTTP 429 with an envelope:

{
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Try again in 12s.",
"retryAfter": 12
}
}

For heavy read workloads, prefer the iCal feed or mirror the JSON data files from our GitHub repo into your own storage.

Response envelope

Every successful response is wrapped in a data envelope:

{ "data": <payload>, "meta": { "..." } }

Errors use a matching error envelope:

{ "error": { "code": "VALIDATION_ERROR", "message": "...", "suggestions": [] } }

See Errors for the full list of error codes.

Caching

Read endpoints include Cache-Control headers tuned by request type:

RequestTTLRationale
Current-year holidays1 hourNew cuti peristiwa might be announced
Past-year holidays24 hoursHistorical data is stable
State list24 hoursRarely changes
/holidays/today15 minutesSame reason as current year

Full endpoint index

EndpointDoc
GET /v1/holidaysHolidays
GET /v1/holidays/checkHolidays
GET /v1/holidays/todayHolidays
GET /v1/holidays/nextHolidays
GET /v1/holidays/betweenHolidays
GET /v1/holidays/long-weekendsHolidays
GET /v1/business-daysBusiness Days
GET /v1/business-days/addBusiness Days
GET /v1/statesStates
GET /v1/states/resolveStates
GET /v1/school/termsSchool
GET /v1/school/holidaysSchool
GET /v1/school/examsSchool
GET /v1/school/is-school-daySchool
GET /v1/feed/ical/{state}Feeds
GET /v1/changelogData change log