Total Hari Libur
-
Libur Nasional
-
Cuti Bersama
-
Bulan Terpadat
-
Daftar Hari Libur Nasional
Dokumentasi REST API
API Hari Libur Nasional gratis, cepat, dan mudah diintegrasikan. Mendukung format respons JSON dengan header CORS diaktifkan secara default.
GET
/api/holidays
Mengambil semua data hari libur nasional dan cuti bersama untuk tahun tertentu (default tahun ini).
Query Parameters
| Parameter | Tipe | Wajib | Deskripsi |
|---|---|---|---|
year |
integer | Tidak | Filter berdasarkan tahun (2011 s/d sekarang + 5 tahun. Default: tahun aktif). |
month |
integer | Tidak | Filter berdasarkan bulan (1 s/d 12). |
force |
boolean | Tidak | Set ke true untuk mengabaikan cache lokal dan memaksa scraping ulang dari sumber data. |
GET
/api/today
Memeriksa apakah hari ini (Waktu Indonesia Barat) adalah hari libur nasional atau cuti bersama.
Query Parameters
| Parameter | Tipe | Wajib | Deskripsi |
|---|---|---|---|
force |
boolean | Tidak | Paksa pembaruan data cache. |
GET
/api/tomorrow
Memeriksa apakah besok (Waktu Indonesia Barat) adalah hari libur nasional atau cuti bersama.
Query Parameters
| Parameter | Tipe | Wajib | Deskripsi |
|---|---|---|---|
force |
boolean | Tidak | Paksa pembaruan data cache. |
Contoh Integrasi Kode
Cara memanggil API Hari Libur ini dari program Anda secara asinkron:
JavaScript (Fetch)
fetch('http://localhost:8080/api/holidays?year=2026')
.then(res => res.json())
.then(data => {
if (data.success) {
console.log(`Menemukan ${data.count} hari libur:`, data.data);
}
})
.catch(err => console.error('Error:', err));
PHP (cURL)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost:8080/api/holidays?year=2026");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
if ($data['success']) {
echo "Total hari libur: " . $data['count'];
}
?>
Interactive API Playground
Live Console
GET
http://localhost:8080
Response: 200 OK
// Click Send Request to test the API...