Holiday API in Python
One request returns the public holidays for a country and year. Country is the two-letter ISO code.
import os
import requests
r = requests.get(
"https://api.apifor.dev/v1/holidays",
params={"country": "DE", "year": 2027, "limit": 200},
headers={"x-api-key": os.environ["APIFOR_API_KEY"]},
timeout=30,
)
r.raise_for_status()
holidays = r.json()["data"]
for h in holidays:
print(h["date"], h["name"])Real rows for Germany from the 28 Nov 2026 snapshot: 2026-12-25 Christmas Day, 2026-12-26 St. Stephen's Day, 2027-01-01 New Year's Day.
Is a date a holiday?
Check the date against the list. is_global is 1 when the holiday applies to the whole country; regional ones list their subdivisions in counties.
from datetime import date
day = date(2027, 1, 1).isoformat()
is_holiday = any(h["date"] == day and h["is_global"] == 1 for h in holidays)
print(is_holiday)Each request uses one credit, and new accounts get 1,000 free requests. Coverage per country is on the holidays page, and every filter is in the reference.