A simple, free API providing public holiday data for Sabah, Malaysia in JSON format. Updated automatically via GitHub Actions.
GET /api/years.json
Returns an array of years for which holiday data is available.
Example response:
[2023, 2024, 2025, 2026]
GET /api/{year}.json
Returns an array of holidays for the specified year.
Example request: /api/2025.json
Example response:
[
{
"date": "Jan 01",
"holiday_name": "New Year's Day"
},
{
"date": "Jan 29",
"holiday_name": "Chinese New Year"
},
...
]
GET /api/metadata.json
Returns metadata about the API, including:
last_updated
: Timestamp when the data was last updatedavailable_years
: List of years for which data is availablefailed_years
: List of years for which data scraping failedtotal_years_available
: Total number of years availableyear_range
: Range of years available (e.g., "2023-2026")Example response:
{
"last_updated": "2025-06-05T15:44:00.000Z",
"available_years": [2023, 2024, 2025, 2026],
"failed_years": [2027],
"total_years_available": 4,
"year_range": "2023-2026"
}
// Get holidays for 2025
fetch('https://sabah-holiday.dydxsoft.my/api/2025.json')
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => console.error('Error:', error));
import requests
# Get holidays for 2025
response = requests.get('https://sabah-holiday.dydxsoft.my/api/2025.json')
holidays = response.json()
print(holidays)
Holiday data is scraped from Office Holidays.
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 5 years in the future. This is automatically calculated based on the current year.
The source code for this API is available on GitHub.