Holiday Calendar Template
- Next.js
- TypeScript
Every public holiday and observance for any country and year, on a full-year calendar with a countdown to the next.
A Next.js holiday calendar. Pick a country and a year to see every public holiday and observance on a twelve-month calendar, a countdown to the next one, and a list of what’s still to come, with how many public holidays land on a weekday. Use it for leave planning, HR and payroll tools, or lift the API route to block holidays out of a booking or delivery calendar.

What it does
- A full year at a glance
- Twelve month grids with public holidays and observances in different colours, and today outlined.
- Next holiday countdown
- Shows the next holiday and how many days away it is, then lists the rest of the year.
- Weekday count
- Counts how many public holidays fall on a weekday, the number that matters for days off.
- Local and English names
- Shows each holiday’s local name, with the English name when your plan includes it.
- Keeps your key private
- The page only calls your own API route, which caches each country and year for a day and limits each visitor to 10 lookups a minute.
How it works
The API route: it checks the country and year, then calls World Holidays.
export async function GET(request: Request) {
const params = new URL(request.url).searchParams;
const country = str(params.get('country'), 2).toUpperCase();
const year = Number(params.get('year'));
if (!/^[A-Z]{2}$/.test(country)) return fail('Pick a country');
if (!Number.isInteger(year) || year < 1900 || year > 2100) return fail('Pick a year between 1900 and 2100');
const key = `holidays:${country}:${year}`;
const hit = fromCache(key, TTL_MS);
if (hit) return Response.json(hit);
const blocked = guard(request);
if (blocked) return blocked;
return respond(async () => {
const data = await callApi('worldholidays', { query: { country, year: String(year) } });
toCache(key, data);
return data;
});
}Deploy it
- Get a free API key
The free plan includes 200 credits a month, no card needed. Create your key.
- Deploy it
Click Deploy to Vercel. Vercel copies the repo to your GitHub account and asks for
APIVERVE_API_KEY: paste your key there. - Open your app
Vercel builds it and gives you a live URL, usually in about a minute. Every push to the repo redeploys it.
Try the World Holidays API — the call this template makes
No key required to try it. Get a key to use it in your app.
{
"status": "ok",
"error": null,
"data": {
"country": "US",
"year": 2026,
"holidays": [
{
"date": "2026-01-01 00:00:00",
"start": "2026-01-01T05:00:00.000Z",
"end": "2026-01-02T05:00:00.000Z",
"name": "New Year's Day",
"type": "public",
"dayOfWeek": "Thursday",
"englishName": "New Year's Day"
},
{
"date": "2026-01-19 00:00:00",
"start": "2026-01-19T05:00:00.000Z",
"end": "2026-01-20T05:00:00.000Z",
"name": "Martin Luther King Jr. Day",
"type": "public",
"dayOfWeek": "Monday",
"englishName": "Martin Luther King Jr. Day"
},
{
"date": "2026-02-14 00:00:00",
"start": "2026-02-14T05:00:00.000Z",
"end": "2026-02-15T05:00:00.000Z",
"name": "Valentine's Day",
"type": "observance",
"dayOfWeek": "Saturday",
"englishName": "Valentine's Day"
},
{
"date": "2026-02-16 00:00:00",
"start": "2026-02-16T05:00:00.000Z",
"end": "2026-02-17T05:00:00.000Z",
"name": "Washington's Birthday",
"type": "public",
"dayOfWeek": "Monday",
"englishName": "Washington's Birthday"
},
{
"date": "2026-03-17 00:00:00",
"start": "2026-03-17T04:00:00.000Z",
"end": "2026-03-18T04:00:00.000Z",
"name": "St. Patrick's Day",
"type": "observance",
"dayOfWeek": "Tuesday",
"englishName": "St. Patrick's Day"
},
{
"date": "2026-04-05 00:00:00",
"start": "2026-04-05T04:00:00.000Z",
"end": "2026-04-06T04:00:00.000Z",
"name": "Easter Sunday",
"type": "observance",
"dayOfWeek": "Sunday",
"englishName": "Easter Sunday"
},
{
"date": "2026-04-15 00:00:00",
"start": "2026-04-15T04:00:00.000Z",
"end": "2026-04-16T04:00:00.000Z",
"name": "Tax Day",
"type": "observance",
"dayOfWeek": "Wednesday",
"englishName": "Tax Day"
},
{
"date": "2026-04-22 00:00:00",
"start": "2026-04-22T04:00:00.000Z",
"end": "2026-04-23T04:00:00.000Z",
"name": "Administrative Professionals Day",
"type": "observance",
"dayOfWeek": "Wednesday",
"englishName": "Administrative Professionals Day"
},
{
"date": "2026-05-10 00:00:00",
"start": "2026-05-10T04:00:00.000Z",
"end": "2026-05-11T04:00:00.000Z",
"name": "Mother's Day",
"type": "observance",
"dayOfWeek": "Sunday",
"englishName": "Mother's Day"
},
{
"date": "2026-05-25 00:00:00",
"start": "2026-05-25T04:00:00.000Z",
"end": "2026-05-26T04:00:00.000Z",
"name": "Memorial Day",
"type": "public",
"dayOfWeek": "Monday",
"englishName": "Memorial Day"
},
{
"date": "2026-06-19 00:00:00",
"start": "2026-06-19T04:00:00.000Z",
"end": "2026-06-20T04:00:00.000Z",
"name": "Juneteenth",
"type": "public",
"dayOfWeek": "Friday",
"englishName": "Juneteenth"
},
{
"date": "2026-06-21 00:00:00",
"start": "2026-06-21T04:00:00.000Z",
"end": "2026-06-22T04:00:00.000Z",
"name": "Father's Day",
"type": "observance",
"dayOfWeek": "Sunday",
"englishName": "Father's Day"
},
{
"date": "2026-07-03 00:00:00",
"start": "2026-07-03T04:00:00.000Z",
"end": "2026-07-04T04:00:00.000Z",
"name": "Independence Day (substitute day)",
"type": "public",
"substitute": true,
"dayOfWeek": "Friday",
"englishName": "Independence Day (substitute day)"
},
{
"date": "2026-07-04 00:00:00",
"start": "2026-07-04T04:00:00.000Z",
"end": "2026-07-05T04:00:00.000Z",
"name": "Independence Day",
"type": "public",
"dayOfWeek": "Saturday",
"englishName": "Independence Day"
},
{
"date": "2026-09-07 00:00:00",
"start": "2026-09-07T04:00:00.000Z",
"end": "2026-09-08T04:00:00.000Z",
"name": "Labor Day",
"type": "public",
"dayOfWeek": "Monday",
"englishName": "Labour Day"
},
{
"date": "2026-10-12 00:00:00",
"start": "2026-10-12T04:00:00.000Z",
"end": "2026-10-13T04:00:00.000Z",
"name": "Columbus Day",
"type": "public",
"dayOfWeek": "Monday",
"englishName": "Columbus Day"
},
{
"date": "2026-10-31 18:00:00",
"start": "2026-10-31T22:00:00.000Z",
"end": "2026-11-01T04:00:00.000Z",
"name": "Halloween",
"type": "observance",
"dayOfWeek": "Saturday",
"englishName": "Halloween"
},
{
"date": "2026-11-11 00:00:00",
"start": "2026-11-11T05:00:00.000Z",
"end": "2026-11-12T05:00:00.000Z",
"name": "Veterans Day",
"type": "public",
"dayOfWeek": "Wednesday",
"englishName": "Veterans Day"
},
{
"date": "2026-11-26 00:00:00",
"start": "2026-11-26T05:00:00.000Z",
"end": "2026-11-27T05:00:00.000Z",
"name": "Thanksgiving Day",
"type": "public",
"dayOfWeek": "Thursday",
"englishName": "Thanksgiving Day"
},
{
"date": "2026-11-27 00:00:00",
"start": "2026-11-27T05:00:00.000Z",
"end": "2026-11-28T05:00:00.000Z",
"name": "Day after Thanksgiving Day",
"type": "observance",
"dayOfWeek": "Friday",
"englishName": "Day after Thanksgiving Day"
},
{
"date": "2026-12-24 00:00:00",
"start": "2026-12-24T05:00:00.000Z",
"end": "2026-12-25T05:00:00.000Z",
"name": "Christmas Eve",
"type": "optional",
"dayOfWeek": "Thursday",
"englishName": "Christmas Eve"
},
{
"date": "2026-12-25 00:00:00",
"start": "2026-12-25T05:00:00.000Z",
"end": "2026-12-26T05:00:00.000Z",
"name": "Christmas Day",
"type": "public",
"dayOfWeek": "Friday",
"englishName": "Christmas Day"
},
{
"date": "2026-12-31 00:00:00",
"start": "2026-12-31T05:00:00.000Z",
"end": "2027-01-01T05:00:00.000Z",
"name": "New Year's Eve",
"type": "observance",
"dayOfWeek": "Thursday",
"englishName": "New Year's Eve"
}
]
}
}