A simple, free API providing public holiday data for Malaysia states in JSON format. Updated automatically via GitHub Actions.
10/02/2026
GET /api/states.json
Returns an array of supported states with their endpoint codes.
Example response:
[
{ "code": "sabah", "name": "Sabah" },
{ "code": "sarawak", "name": "Sarawak" }
]
GET /api/years.json
Returns available years for Sabah to preserve backward compatibility.
Example response:
[2023, 2024, 2025, 2026]
GET /api/{state}/{year}.json
Returns an array of holidays for the specified state and year.
Example request: /api/sabah/2025.json
Example response:
[
{
"date": "Jan 01",
"holiday_name": "New Year's Day"
},
{
"date": "Jan 29",
"holiday_name": "Chinese New Year"
},
...
]
Backward-compatible Sabah endpoint: /api/{year}.json
GET /api/metadata.json
Returns metadata about the API, including:
last_updated: Timestamp when the data was last updated
state_count: Number of states supportedstates: List of supported statesstates_metadata: Per-state available years and scrape
status
Example response:
{
"last_updated": "2025-06-05T15:44:00.000Z",
"state_count": 16,
"default_state": "sabah",
"states": [{ "code": "sabah", "name": "Sabah" }],
"states_metadata": {
"sabah": {
"available_years": [2023, 2024, 2025, 2026],
"failed_years": [],
"total_years_available": 4,
"year_range": "2023-2026"
}
}
}
// Get Sabah holidays for 2025
fetch('https://sabah-holiday.dydxsoft.my/api/sabah/2025.json')
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => console.error('Error:', error));
import requests
# Get Sarawak holidays for 2025
response = requests.get('https://sabah-holiday.dydxsoft.my/api/sarawak/2025.json')
holidays = response.json()
print(holidays)
Holiday data is scraped from Office Holidays, covering multiple Malaysia states.
The API data is automatically updated on the 1st of each year (Jan 01) via GitHub Actions. The script includes retry logic with exponential backoff to handle temporary failures when scraping data.
By default, the API generates data for a range of years from 2 years in the past to 2 years in the future, for every supported state.
The source code for this API is available on GitHub.