- Guides
- public holidays API free
Public holidays API: holidays for 200+ countries as JSON
GET /v1/holidays?country=DE&year=2027 returns every public holiday in Germany for 2027, and the same call works for 204 countries in our current snapshot. Rows come from Nager.Date, replaced by official government lists for the UK, Singapore and Indonesia, at 1 credit per call with 1,000 free requests to start.
Last checked . Service: Public holidays API. Reference: endpoint docs.
What each row tells you
date, name in English and local_name. is_global is 1 when the holiday applies to the whole country; regional holidays list their ISO 3166-2 subdivisions in counties. In the example, 2 January is a bank holiday in Scotland only, so it has counties GB-SCT and is_global 0. types separates public holidays from observances and optional days.
Filter by region with subdivision: country=GB&subdivision=GB-SCT returns Scottish holidays plus the national ones. q searches names, and limit goes up to 200, enough for a whole year in one call.
Request
Send your key in the x-api-key header. New accounts get 1,000 free requests after email verification; the quickstart takes about a minute.
curl 'https://api.apifor.dev/v1/holidays?country=GB&year=2026&limit=2' \
-H 'x-api-key: YOUR_API_KEY'import os
import requests
r = requests.get(
"https://api.apifor.dev/v1/holidays",
params={
"country": "GB",
"year": "2026",
"limit": "2",
},
headers={"x-api-key": os.environ["APIFOR_API_KEY"]},
timeout=30,
)
r.raise_for_status()
print(r.json()["data"])const res = await fetch("https://api.apifor.dev/v1/holidays?country=GB&year=2026&limit=2", {
headers: { "x-api-key": process.env.APIFOR_API_KEY },
});
const { data } = await res.json();
console.log(data);Response
This is the example recorded from the live API and published in our OpenAPI spec. The full spec is at api.apifor.dev/v1/openapi.json.
{
"success": true,
"data": [
{
"id": "GB-2026-01-01-1",
"country_code": "GB",
"date": "2026-01-01",
"year": 2026,
"local_name": "New Year's Day",
"name": "New Year's Day",
"is_global": 1,
"is_fixed": 0,
"counties": null,
"types": "Public",
"launch_year": null
},
{
"id": "GB-2026-01-02-1",
"country_code": "GB",
"date": "2026-01-02",
"year": 2026,
"local_name": "2nd January",
"name": "2nd January",
"is_global": 0,
"is_fixed": 0,
"counties": "GB-SCT",
"types": "Public",
"launch_year": null
}
],
"meta": {
"total": 2,
"page": 1,
"per_page": 2,
"total_pages": 1,
"attribution": {
"source": "https://www.gov.uk/bank-holidays",
"licence": "Open Government Licence v3.0",
"license": "Open Government Licence v3.0",
"license_url": "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/",
"source_url": "https://www.gov.uk/bank-holidays",
"attribution_page": "https://apifor.dev/sources",
"notice": "Contains public sector information licensed under the Open Government Licence v3.0 (GOV.UK bank holidays)."
},
"sources": [
{
"country": "GB",
"name": "GOV.UK bank holidays (England and Wales, Scotland, Northern Ireland)",
"url": "https://www.gov.uk/bank-holidays",
"licence": "Open Government Licence v3.0",
"licence_url": "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/",
"notice": "Contains public sector information licensed under the Open Government Licence v3.0 (GOV.UK bank holidays)."
}
]
}
}Official lists where they exist
For the UK we use GOV.UK's bank holidays for each nation, 2021 to 2029. For Singapore, the Ministry of Manpower list for 2020 to 2027. For Indonesia, the joint ministerial decree, with joint leave days typed Optional. Those replace the generic rows for the years they cover, and meta.sources tells you which source answered.
Islamic holidays set by moon sighting are a weak spot for every holiday dataset. Outside the countries above, treat them as provisional.
Working days
To count business days, fetch the year once, keep the dates where is_global is 1 (or where counties includes your region) and skip weekends in your own code. Cache the year; holiday lists rarely change once published.
Errors, limits and cost
A missing or wrong key returns 401, bad parameters return 400 with an error.code, and an unknown id returns 404. Rate limits are per key: a limited request gets 429 with a Retry-After header in seconds, so wait that long and retry. Calls that fail before any work starts are refunded. Details are in errors and rate limits.
This request costs 1 credit. Pricing is prepaid: 1,000 free requests once after email verification, then packs from $5 for 5,000 requests to $149 for 400,000. Credits never expire and there is no subscription. See pricing.
From an AI assistant
The same data is available as a tool on the APIFor MCP server at https://mcp.apifor.dev/mcp. Add it as a remote server in any client that supports remote MCP, sign in with OAuth or send your API key as a Bearer token, and ask in plain language. MCP calls use the same key and credits as REST. Setup steps are on the MCP page.
Alternatives
- Nager.Date: Free and keyless, and the main source for APIFor's rows. On 1 Dec 2026, /api/v3/PublicHolidays/2027/DE returned Germany's 2027 holidays. If holidays are all you need, use it directly.
- Calendarific: Subscription plans with a free tier of 500 calls a month that requires attribution, per its pricing page.
Facts about other services come from their own pages or a test call on 1 Dec 2026. Prices and limits change, so confirm them there.
Source and licence
Nager.Date, MIT. UK: contains public sector information licensed under the Open Government Licence v3.0 (GOV.UK bank holidays). Singapore: MOM Public Holidays via data.gov.sg, Singapore Open Data Licence v1.0.
Every APIFor response carries the same attribution in meta.attribution. All sources are listed on sources and licences.
FAQ
Is there a free public holidays API?
Nager.Date is free with no key. APIFor gives 1,000 free requests once and then charges 1 credit per call, and adds official government lists for some countries plus other datasets on the same key.
How do I get regional holidays?
Pass subdivision with an ISO 3166-2 code, such as GB-SCT or DE-BY. You get that region's holidays plus national ones.
How many countries are covered?
204 countries and territories in the current snapshot.