Tanggal Merah API

An API for Indonesian public holidays and collective leave days. Query by year, month, or check a specific date.

Try it now

Click any link to see a live response — no setup needed.

Endpoints

Three endpoints, all GET, all returning the same JSON envelope.

GET/api/holidays

Returns all public holidays and collective leave days for a given year. Optionally filter by month or type.

ParamTypeDescription
year*integer4-digit year, e.g. 2026
monthintegerFilter by month 112
typestringholiday or leave — omit for both

Request

GET /api/holidays?year=2026
GET /api/holidays?year=2026&month=3
GET /api/holidays?year=2026&type=holiday

Response

{
  "success": true,
  "data": [
    {
      "date": "2026-01-01",
      "day": "Kamis",
      "name": "Tahun Baru 2026 Masehi",
      "type": "holiday"
    }
  ],
  "meta": { "year": 2026, "count": 17 }
}
GET/api/check

Check whether a specific date is a holiday, collective leave day, or regular workday. The most useful endpoint — pass today's date and get a boolean answer.

ParamTypeDescription
date*stringISO 8601 date — YYYY-MM-DD

Request

GET /api/check?date=2026-03-21

Response

{
  "success": true,
  "data": {
    "date": "2026-03-21",
    "is_holiday": true,
    "is_leave": false,
    "is_off_day": true,
    "holidays": [...]
  }
}

is_off_day is true when the date is a holiday ora collective leave day — the simplest check for “should my app treat today as non-working?”

GET/api/years

Returns all years that have holiday data. No parameters required.

Request

GET /api/years

Response

{
  "success": true,
  "data": [2020, 2021, 2022,
           2023, 2024, 2025,
           2026]
}

Response Envelope

Every response follows the same top-level shape.

{
  "success": boolean,
  "data": T,
  "meta"?: {
    "year": number,
    "month"?: number,
    "count": number
  }
}

Errors

Standard HTTP status codes with a consistent body.

// 400 — invalid params
{ "success": false,
  "error": "Invalid date format." }

// 404 — no data for year
{ "success": false,
  "error": "No data for year 2099." }

Holiday Types

The type field on every entry is one of two values.

holiday

Hari Libur Nasional

Mandatory national public holidays — all employees are legally entitled to a day off.

e.g. Idul Fitri, Hari Kemerdekaan, Natal

leave

Cuti Bersama

Government-designated collective leave days — typically bridge days around a public holiday.

e.g. bridge days before/after Lebaran or Natal