Public Holidays API
The Public Holidays API provides the statutory days off for 240+ countries and territories, including regional holidays for states and provinces and the day a holiday is observed when it falls on a weekend. Most countries are covered from 1980 to 2050.
Invalid input returns HTTP 400 with an error message: an unrecognized country, a country without public holiday data, a malformed date, or a year outside the country's range (the error lists the available years).
Available endpoints:
- /v1/publicholidays - Get public holidays for a country and year
- /v1/ispublicholiday - Check whether a date is a public holiday in a country
For non-public holidays, religious holidays, and other special events, please use the Holidays API instead.
From 5,929 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 308ms | 330ms | 359ms | 615ms | 1103ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
https://api.api-ninjas.com/v1/publicholidays
Returns a list of public holidays for a given country and year.
To look up whether a given date is a public holiday, use the /v1/ispublicholiday endpoint instead.
Parameters
countryrequired2-letter ISO 3166-1 alpha-2 country code (preferred, e.g.
US), 3-letter alpha-3 code (e.g.USA), or English country name (e.g.United States). Not case-sensitive. Names must match exactly; common short names such asUK,USA,UAEandSouth Koreaalso work. An unrecognized country, or one without public holiday data, returns a400error.yearoptional Premium onlyCalendar year between
1980and2050(inclusive); a few countries cover fewer years. Defaults to the current year. Free plans can omit it or pass the current year; other years require a premium plan.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
The /v1/publicholidays endpoint returns a JSON array of objects, each with the following fields, or an error if the request is unsuccessful.
nameHoliday name. When a holiday that falls on a weekend is observed on another day, that day off is a separate row named e.g.
Independence Day (observed).local_nameLocal holiday name. This is often (but not always) the same as the name.
dateDate of the day off in
YYYY-MM-DDformat.country2-letter ISO 3166-1 alpha-2 country code.
yearCalendar year of
date.regionsISO 3166-2 codes of the states, provinces or regions where the holiday applies (e.g.
GB-SCT).federaltruewhen the holiday applies nationwide. Whenfalse,regionslists where it applies.actual_dateCalendar date of the holiday itself. Differs from
dateonly on observed days.observedtruewhendateis an observed or substitute day off for a holiday that falls on another day.holiday_idStable identifier of the holiday, the same every year (e.g.
US.independence_day). An observed day shares the id of its holiday.statusconfirmed, ortentativefor dates that depend on a lunar sighting or have not yet been officially announced. Tentative dates may move by a day.
Live Demo
Get a free API key to get started — no credit card required.
Code Examples
curl -X GET "https://api.api-ninjas.com/v1/publicholidays?country=US" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.
https://api.api-ninjas.com/v1/ispublicholiday
Returns whether a given date is a nationwide public holiday in a country. Pass subdivision to also count the holidays of one state, province or region.
Parameters
countryrequired2-letter ISO 3166-1 alpha-2 country code (preferred), 3-letter alpha-3 code, or English country name, matched exactly as for /v1/publicholidays. An unrecognized country, or one without public holiday data, returns a
400error.daterequiredDate in
YYYY-MM-DDformat. Must be between1980-01-01and2050-12-31(inclusive). Note: dates in future calendar years are Premium only. Free plans can query past years and the current year.subdivisionoptionalISO 3166-2 code of a state, province or region (e.g.
DE-BY, or justBY). Regional holidays count only when you pass the region they apply to: Corpus Christi is a public holiday withcountry=DE&subdivision=BYbut not forcountry=DEalone. An unknown code returns a400error.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
The /v1/ispublicholiday endpoint returns a JSON object with the following fields, or an error if the request is unsuccessful.
is_public_holidayWhether the date is a public holiday nationwide, or in
subdivisionwhen given.public_holiday_nameName of the public holiday.
dateThe queried date in
YYYY-MM-DDformat.countryThe resolved 2-letter ISO 3166-1 alpha-2 country code (e.g.
DEwhen you passGermany).subdivisionThe ISO 3166-2 code you passed, normalized (e.g.
DE-BY).
Live Demo
Code Examples
curl -X GET "https://api.api-ninjas.com/v1/ispublicholiday?country=US&date=2026-01-01" \
-H "X-Api-Key: YOUR_API_KEY"Frequently Asked Questions
Can I use the Public Holidays API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the Public Holidays API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.How do I get an API key and start using the Public Holidays API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.What happens if a request to the Public Holidays API fails?
The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.What date range and country coverage does the Public Holidays API support?
The/v1/publicholidaysendpoint returns public holiday data for 240+ countries and territories, from 1980 to 2050 for most countries; a year outside a country's range returns a 400 error listing the available years. Thecountryparameter accepts a 2-letter or 3-letter ISO code or an exact English country name, and a country without data returns a 400 error. For non-public, religious, or other special events, use the Holidays API instead.What is the difference between the /v1/publicholidays and /v1/ispublicholiday endpoints?
The/v1/publicholidaysendpoint returns a full list of public holidays for a givencountryandyear, while/v1/ispublicholidaychecks whether a singledate(inYYYY-MM-DDformat) is a public holiday and returns anis_public_holidayboolean plus thepublic_holiday_name. To count business days that exclude these holidays, see the Working Days API.What fields are returned for each holiday from the /v1/publicholidays endpoint?
Each object in the JSON array includesname,local_name,date,country,year, aregionslist of ISO 3166-2 codes where the holiday applies, afederalflag that is true when the holiday applies nationwide, the holiday'sactual_date, anobservedflag for days off moved from a weekend, a stableholiday_idand astatusofconfirmedortentative. If a request is unsuccessful you will instead receive an error described in the error codes reference.How do I query public holidays for a past or future year?
Pass the optionalyearparameter (any calendar year between 1980 and 2050 inclusive) to the/v1/publicholidaysendpoint; it defaults to the current year. Free plans can request the current year, and other years need a premium plan, so see pricing for access. For looking up country codes and names, the Country API can help.
Explore API integration use cases for recommended APIs and workflow examples.