Helenis API
Start for free

Web data & toolsPublic Holidays

Public Holidays API: Holidays, Working Days and Due Dates in Python

Public holidays API guide: list holidays for 250 countries and their regions, count working days, compute due dates and find long weekends, with Python.

Public Holidays API cover: a beach umbrella sticker, an arrow and a JSON response for Germany, subdivision BY, 31 calendar days, 22 working days and 8 weekend days.
December 2026 in Bavaria: 31 days, 8 weekend days, Christmas on a Friday, 22 working days.

"Delivered in 3 business days", "payment due in 30 working days", "SLA response within 2 business days": each of these promises hides a holiday calendar. A hard-coded list of dates works for one country and one year, then breaks on Easter, on a holiday that falls on a Saturday, on the Bavarian holidays your Berlin office does not have, or on a Saudi weekend that starts on Friday.

A public holidays API keeps those calendars for you. This article walks through the traps that make holiday logic hard, then uses the Public Holidays & Working Days API from Python to list the holidays of a country or region, check a date, count working days between two dates, compute due dates, and find long weekends, for 250 countries and any year from 1950 to 2100.

Why holiday logic breaks

Six traps account for most date bugs in delivery estimates, payroll and SLA code.

Trap Example (real data below) What a naive list gets wrong
Moving feasts Ascension is Easter + 39 days: 14 May 2026 in France A fixed list is wrong next year
Observed days US Independence Day 2026 is a Saturday, observed Friday 3 July The Friday off is missing
Regions England has Easter Monday and the Late Summer Bank Holiday; the UK-wide list does not Wrong for most of the UK
Local weekends Saudi Arabia rests on Friday and Saturday Friday counted as a working day
Make-up working days China works on Saturday 10 October 2026 to extend Golden Week Saturday counted as a day off
Other calendars Diwali, Eid, Lunar New Year follow lunar or lunisolar calendars Dates drift every year

The API computes all of this from the open-source holidays library, a community-maintained calendar that covers moving feasts, lunar calendars and new laws, inside the service: no upstream to time out, and answers in milliseconds.

List the public holidays of a country

GET /v1/holidays/list takes country (ISO 3166 two-letter code) and year. The examples use Python and requests; the API reference lists every parameter.

Python
import requests

HOST = "public-holidays-working-days-200-countries.p.rapidapi.com"
API = f"https://{HOST}"
HEADERS = {"x-rapidapi-key": "YOUR_API_KEY", "x-rapidapi-host": HOST}


def holidays_api(path: str, **params) -> dict:
    response = requests.get(
        f"{API}/v1/holidays/{path}", headers=HEADERS, params=params, timeout=15
    )
    response.raise_for_status()
    return response.json()


france = holidays_api("list", country="FR", year=2026)
for day in france["holidays"]:
    print(day["date"], day["weekday"], day["name"])

The same call with curl:

Terminal
curl "https://public-holidays-working-days-200-countries.p.rapidapi.com/v1/holidays/list?country=FR&year=2026" \
  -H "x-rapidapi-key: YOUR_API_KEY" \
  -H "x-rapidapi-host: public-holidays-working-days-200-countries.p.rapidapi.com"

The real response, shortened in the middle:

JSON
{
  "country": "FR",
  "country_name": "France",
  "year": 2026,
  "language": "en_US",
  "count": 11,
  "holidays": [
    { "date": "2026-01-01", "name": "New Year's Day", "weekday": "Thursday", "category": "public" },
    { "date": "2026-04-06", "name": "Easter Monday", "weekday": "Monday", "category": "public" },
    { "date": "2026-05-14", "name": "Ascension Day", "weekday": "Thursday", "category": "public" },
    { "date": "2026-05-25", "name": "Pentecost Monday", "weekday": "Monday", "category": "public" },
    { "date": "2026-07-14", "name": "National Day", "weekday": "Tuesday", "category": "public" },
    { "...": "..." },
    { "date": "2026-12-25", "name": "Christmas Day", "weekday": "Friday", "category": "public" }
  ],
  "note": "National holidays only: add subdivision for the regional ones (codes in Get Supported Countries)."
}

France has 11 public holidays in 2026; two of them (Assumption on a Saturday, All Saints' Day on a Sunday) fall on a weekend, which changes the working-day count. Names come in English by default; language=fr returns the French names.

Regional holidays and the note field

Many countries have holidays that apply only in some regions. The UK is the classic case: asked without a region, the API returns the 7 holidays common to the whole country, plus a note. With subdivision=ENG, England gets 9:

JSON
{
  "country": "GB",
  "country_name": "United Kingdom",
  "subdivision": "ENG",
  "year": 2026,
  "count": 9,
  "holidays": [
    { "date": "2026-04-03", "name": "Good Friday", "weekday": "Friday", "category": "public" },
    { "date": "2026-04-06", "name": "Easter Monday", "weekday": "Monday", "category": "public" },
    { "date": "2026-08-31", "name": "Late Summer Bank Holiday", "weekday": "Monday", "category": "public" },
    { "date": "2026-12-26", "name": "Boxing Day", "weekday": "Saturday", "category": "public" },
    { "date": "2026-12-28", "name": "Boxing Day (observed)", "weekday": "Monday", "category": "public" },
    { "...": "..." }
  ]
}

Boxing Day on a Saturday moves to Monday 28 December, listed as its own observed day. The same mechanism produces Independence Day (observed) on Friday 3 July 2026 in the US list. Treat the note as a signal: if it is present, your users probably need a subdivision. Germany has 16 Länder codes plus the city of Augsburg, which has its own holiday; the US has its states, Spain its communities, Switzerland its cantons.

Is this date a working day?

GET /v1/holidays/check answers the most common question in one call: holiday, weekend, working day.

Python
day = holidays_api("check", country="FR", date="2026-07-14")
print(day["is_working_day"], day["holiday_names"])  # False ['National Day']
JSON
{
  "country": "FR",
  "date": "2026-07-14",
  "weekday": "Tuesday",
  "is_holiday": true,
  "holiday_names": ["National Day"],
  "holidays": [{ "date": "2026-07-14", "name": "National Day", "weekday": "Tuesday", "category": "public" }],
  "is_weekend": false,
  "is_working_day": false
}

The weekend is the country's own. Friday 4 December 2026 in Saudi Arabia is not a holiday, but it is a weekend day:

JSON
{
  "country": "SA",
  "date": "2026-12-04",
  "weekday": "Friday",
  "is_holiday": false,
  "holiday_names": [],
  "holidays": [],
  "is_weekend": true,
  "is_working_day": false
}

Count working days between two dates

GET /v1/holidays/working-days counts working days, weekend days and the holidays between two dates, both included, over up to 10 years. December 2026 in Bavaria:

Python
december = holidays_api(
    "working-days", country="DE", subdivision="BY", start="2026-12-01", end="2026-12-31"
)
print(december["working_days"])  # 22
JSON
{
  "country": "DE",
  "subdivision": "BY",
  "start": "2026-12-01",
  "end": "2026-12-31",
  "calendar_days": 31,
  "working_days": 22,
  "weekend_days": 8,
  "holidays": [
    { "date": "2026-12-25", "name": "Christmas Day", "weekday": "Friday", "category": "public" },
    { "date": "2026-12-26", "name": "Second Day of Christmas", "weekday": "Saturday", "category": "public" }
  ]
}

31 days, 8 weekend days, and one holiday on a weekday: 22 working days. Christmas Eve and New Year's Eve are not public holidays in Germany, so they count as working days, which matches the law but not every company's practice.

China is where counting by weekday fails the hardest. The two weeks around Golden Week 2026:

JSON
{
  "country": "CN",
  "start": "2026-09-28",
  "end": "2026-10-11",
  "calendar_days": 14,
  "working_days": 6,
  "weekend_days": 4,
  "holidays": [
    { "date": "2026-10-01", "name": "National Day", "weekday": "Thursday", "category": "public" },
    { "date": "2026-10-02", "name": "National Day", "weekday": "Friday", "category": "public" },
    { "date": "2026-10-03", "name": "National Day", "weekday": "Saturday", "category": "public" },
    { "date": "2026-10-05", "name": "National Day (observed)", "weekday": "Monday", "category": "public" },
    { "date": "2026-10-06", "name": "Day off (substituted from 09/20/2026)", "weekday": "Tuesday", "category": "public" },
    { "date": "2026-10-07", "name": "Day off (substituted from 10/10/2026)", "weekday": "Wednesday", "category": "public" }
  ]
}

The 6 working days are 28-30 September and 8-10 October: Saturday 10 October is worked, because its rest was moved to 7 October. A count that skips every Saturday and Sunday gives 5, even with the right holiday list.

Add working days: due dates and delivery estimates

GET /v1/holidays/add-working-days returns the date N working days after a date, skipping weekends and holidays, and lists the holidays it skipped. days goes from -1000 to 1000; a negative value goes back in time.

Three real answers:

Question Call result Skipped
Order on 23 Dec in Bavaria, ships in 3 working days country=DE&subdivision=BY&date=2026-12-23&days=3 2026-12-29 Christmas Day, Second Day of Christmas
Ticket on the Wednesday before Thanksgiving, SLA 2 business days country=US&date=2026-11-25&days=2 2026-11-30 Thanksgiving Day
Must leave the warehouse 5 working days before 4 Jan in France country=FR&date=2027-01-04&days=-5 2026-12-24 New Year's Day, Christmas Day

The Bavarian one, in full:

JSON
{
  "country": "DE",
  "subdivision": "BY",
  "date": "2026-12-23",
  "working_days": 3,
  "result": "2026-12-29",
  "skipped_holidays": [
    { "date": "2026-12-25", "name": "Christmas Day", "weekday": "Friday", "category": "public" },
    { "date": "2026-12-26", "name": "Second Day of Christmas", "weekday": "Saturday", "category": "public" }
  ]
}

The start date itself is not counted: 3 working days after Wednesday 23 December are the 24th, the 28th and the 29th. Note the US answer: the Friday after Thanksgiving is a normal working day under federal rules, even if your support team is off.

Production pattern: one call per answer, or one call per year

Each call costs 1 credit, so there are two sensible designs:

  • Call per question when answers are rare (a due date per invoice, an SLA per ticket). Simple, and the API handles regions, weekends and observed days.
  • Cache the year when you compute dates in a loop (a delivery estimate on every product page). Fetch /list once per country, subdivision and year, and do the arithmetic locally. The weekend days of each country are in /countries.
Python
import calendar
import datetime as dt
import functools


@functools.cache
def days_off(country: str, year: int, subdivision: str | None = None) -> frozenset:
    params = {"country": country, "year": year}
    if subdivision:
        params["subdivision"] = subdivision
    data = holidays_api("list", **params)
    return frozenset(dt.date.fromisoformat(h["date"]) for h in data["holidays"])


def add_working_days(start: dt.date, days: int, country: str, weekend: set[str]):
    current, left = start, days
    while left > 0:
        current += dt.timedelta(days=1)
        if calendar.day_name[current.weekday()] in weekend:
            continue
        if current in days_off(country, current.year):
            continue
        left -= 1
    return current


print(add_working_days(dt.date(2026, 12, 23), 3, "FR", {"Saturday", "Sunday"}))

The local version covers ordinary weekends and listed holidays; it does not know China's worked Saturdays. Use the endpoint for countries with make-up working days, or when correctness matters more than the credit.

Next holidays and long weekends

GET /v1/holidays/next lists the coming holidays with a countdown. Asked for the US on 25 November 2026 with count=3: Thanksgiving Day in 1 day, Christmas Day in 30, New Year's Day in 37 (days_until).

GET /v1/holidays/long-weekends finds every stretch of 3 or more days off around a holiday, and the 4-day weekends a single bridge day would create. France 2026 has 8; three of them need one day off:

JSON
{
  "country": "FR",
  "year": 2026,
  "count": 8,
  "long_weekends": [
    {
      "start": "2026-05-14",
      "end": "2026-05-17",
      "days": 4,
      "bridge_days": ["2026-05-15"],
      "holidays": [{ "date": "2026-05-14", "name": "Ascension Day", "weekday": "Thursday", "category": "public" }]
    },
    {
      "start": "2026-07-11",
      "end": "2026-07-14",
      "days": 4,
      "bridge_days": ["2026-07-13"],
      "holidays": [{ "date": "2026-07-14", "name": "National Day", "weekday": "Tuesday", "category": "public" }]
    },
    { "...": "..." }
  ]
}

The French call it "faire le pont". Travel sites price these weekends higher, leave planners suggest them, and support teams staff for them.

Bank holidays and other categories

Public holidays are the default. categories adds the extra categories a country defines, such as bank, government, optional, school or unofficial observances, in 79 countries. Belgium with categories=bank returns 15 days instead of 12, including Good Friday and the Friday after Ascension Day, which are banking holidays but not public ones. Bank, government and religious categories count as days off in the working-day maths; observances and school holidays are listed only. /countries gives each country's categories, weekend, languages and subdivision codes in one call.

Bulk calendars without code on Apify

The same engine runs as an Apify Actor, Public Holidays Calendar - 250 Countries, Regions & Any Year, which exports the holidays of several countries and years as one table for spreadsheets and BI tools. It costs $0.0005 per holiday returned, and the Apify free plan covers 5 country-years per run.

What it costs

1 credit per call, whatever the endpoint. Failed calls (4xx, 5xx) use no credits.

Plan Price per month Credits In practice
BASIC Free 10 per day 10 calls a day to test
PRO $1.99 100,000 about $0.00002 per call
ULTRA $4.99 500,000 about $0.00001 per call
MEGA $9.99 833,000 about $0.000012 per call

Beyond the monthly quota, paid plans continue at $0.0002 per credit.

What the public holidays API does not do

  • No company calendars. Christmas Eve, the Friday after Thanksgiving or a French employer's "journée de solidarité" on Pentecost Monday are company decisions; add them on your side.
  • No last-minute decrees before the library knows them. A holiday declared by a government at short notice (a state funeral, an extra bridge day) appears after the calendar is updated.
  • No half days. Half-day holidays are listed with their category where the library has them, but working-day counts use whole days.
  • No hours or time zones. A date is a date; to know whether it is 9 a.m. or midnight for a customer, see the SMS send time guide.
  • Bounded ranges. Years 1950 to 2100, ranges of 10 years at most, and shifts of 1,000 working days at most (400 invalid_range or invalid_request otherwise, unbilled).
  • No retail days. Black Friday, Mother's Day and Singles' Day are not public holidays; the marketing calendar guide covers them.

Frequently asked questions

How do I calculate business days between two dates in Python?

Call GET /v1/holidays/working-days?country=...&start=...&end=... (both dates included) and read working_days. To do it locally, numpy.busday_count handles weekends and a holiday list you supply; you still need a correct holiday list per country and region, which is what the API provides.

Is there a free public holidays API?

The BASIC plan is free with 10 calls a day, enough to test or to cache a few calendars. Since a year's calendar rarely changes, one /list call per country and year, cached, covers many apps.

Does it include regional holidays like US states or German Länder?

Yes, with subdivision: BY for Bavaria, CA for California, ENG for England, CT for Catalonia. Without it you get national holidays and a note saying so. /countries lists every subdivision code.

How are holidays that fall on a weekend handled?

Where the law moves them, the observed day is listed with its own name, such as Independence Day (observed) or Boxing Day (observed), and counts as a day off. Where the law does not move them, as in France, the holiday simply falls on the weekend.

Which countries have a Friday-Saturday weekend?

Saudi Arabia is one example; /countries returns the weekend of each country, and every working-day calculation uses it automatically.

Get started

Public Holidays & Working Days API

Public holidays of 250 countries and 651 regions, working days, due dates and long weekends.

  • Public Holidays
  • Working Days
  • Calendar
  • Python
  • Logistics