A comprehensive public holidays API providing holiday data for 60 countries and regions across multiple years (2020-2026). Built with Next.js and TypeScript.
๐ Doc: https://public-holidays.toolhub.run/
- ๐ 60 countries & regions - Comprehensive coverage of public holidays worldwide
- ๐ Multiple years - Data available for 2020, 2021, 2022, 2023, 2024, 2025, and 2026
- ๐ Fast API - Built on Next.js API routes for optimal performance
- ๐จ Interactive documentation - Built-in API tester and documentation
- ๐ฑ Responsive design - Works seamlessly on all devices
The API covers 60 countries and regions including:
- ๐จ๐ณ China (cn)
- ๐บ๐ธ United States (us)
- ๐ฌ๐ง United Kingdom (uk)
- ๐จ๐ฆ Canada (ca)
- ๐ฆ๐บ Australia (au)
- ๐ฉ๐ช Germany (de)
- ๐ซ๐ท France (fr)
- ๐ฏ๐ต Japan (jp)
- ๐ฎ๐ณ India (in)
- ๐ง๐ท Brazil (br)
- ๐ฒ๐ฝ Mexico (mx)
- And 48 more...
See the data directory for the complete list of country codes.
GET https://public-holidays.toolhub.run/api/public-holidays?year={year}&code={code}
year(required) - The year for which to retrieve holidays (e.g., 2020, 2021, 2022, 2023, 2024, 2025, 2026)code(required) - The ISO 3166-1 alpha-2 country/region code (e.g., cn, us, uk, ca)
curl "https://public-holidays.toolhub.run/api/public-holidays?year=2025&code=cn"{
"data": [
{
"localName": "ๅ
ๆฆ",
"name": "New Year's Day",
"code": "CN",
"fixed": true,
"global": true,
"counties": null,
"launchYear": null,
"types": ["Public"],
"startDate": "2025-01-01T00:00:00.000Z",
"endDate": "2025-01-01T23:59:59.999Z"
},
{
"localName": "ๆฅ่",
"name": "Spring Festival (Chinese New Year)",
"code": "CN",
"fixed": false,
"global": true,
"counties": null,
"launchYear": null,
"types": ["Public"],
"startDate": "2025-01-28T00:00:00.000Z",
"endDate": "2025-02-04T23:59:59.999Z"
},
{
"localName": "ๆธ
ๆ่",
"name": "Tomb Sweeping Day (Qingming Festival)",
"code": "CN",
"fixed": false,
"global": true,
"counties": null,
"launchYear": null,
"types": ["Public"],
"startDate": "2025-04-04T00:00:00.000Z",
"endDate": "2025-04-06T23:59:59.999Z"
},
{
"localName": "ๅณๅจ่",
"name": "Labor Day",
"code": "CN",
"fixed": true,
"global": true,
"counties": null,
"launchYear": null,
"types": ["Public"],
"startDate": "2025-05-01T00:00:00.000Z",
"endDate": "2025-05-05T23:59:59.999Z"
},
{
"localName": "็ซฏๅ่",
"name": "Dragon Boat Festival",
"code": "CN",
"fixed": false,
"global": true,
"counties": null,
"launchYear": null,
"types": ["Public"],
"startDate": "2025-05-31T00:00:00.000Z",
"endDate": "2025-06-02T23:59:59.999Z"
},
{
"localName": "ๅฝๅบ่ / ไธญ็ง่",
"name": "National Day & Mid-Autumn Festival",
"code": "CN",
"fixed": true,
"global": true,
"counties": null,
"launchYear": 1949,
"types": ["Public"],
"startDate": "2025-10-01T00:00:00.000Z",
"endDate": "2025-10-08T23:59:59.999Z"
}
]
}400 bad request - Missing required parameters
{
"error": "Both year and code parameters are required"
}404 not found - Data not available for specified year/country
{
"error": "Data not found for the specified year and country/region code"
}- Node.js 18+
- pnpm (recommended) or npm
- Clone the repository:
git clone https://github.com/headwindz/public-holidays
cd public-holidays- Install dependencies:
pnpm install- Run the development server:
pnpm dev- Open http://localhost:3000 to view the application
pnpm build
pnpm startpublic-holidays/
โโโ app/
โ โโโ api/
โ โ โโโ public-holidays/
โ โ โโโ route.ts # API endpoint
โ โโโ globals.css # Global styles
โ โโโ layout.tsx # Root layout
โ โโโ page.tsx # Landing page
โโโ data/
โ โโโ 2020/ # 2020 holiday data
โ โโโ 2021/ # 2021 holiday data
โ โโโ 2022/ # 2022 holiday data
โ โโโ 2023/ # 2023 holiday data
โ โโโ 2024/ # 2024 holiday data
โ โโโ 2025/ # 2025 holiday data
โ โโโ cn/
โ โ โโโ index.json
โ โโโ us/
โ โ โโโ index.json
โ โโโ ... # 60 countries total
โโโ package.json
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- Package manager: pnpm
Holiday data is generated by AI and includes:
- Fixed national holidays
- Movable holidays (Easter, Lunar New Year, Ramadan, etc.)
- Holiday durations
- Bank holidays
Note: While the data is generated with care, please verify critical dates with official government sources for production use. If you find any discrepancies, feel free to open an issue.
Contributions are welcome! Please feel free to submit a Issue or Pull Request.
This project is open source and available under the MIT License.