Public Holidays API
The Public Holidays API provides public holiday information for countries around the world. Get holiday data from 1980 to 2050 for over 100 countries.
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
/v1/publicholidays GET
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 country code or full country name.
yearoptional premium onlyCalendar year between
1980and2050(inclusive). Defaults to current year.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.
nameHoliday name.
local_nameLocal holiday name. This is often (but not always) the same as the name.
dateHoliday date.
country2-letter ISO country code.
yearCalendar year.
regionsList of regions where the holiday is observed.
federalWhether the holiday is a federal holiday.
Sample Request Live Demo!
Try our APIs in the API playground
Sign up for a free API key to get started — no credit card required.
https://api.api-ninjas.com/v1/publicholidays?country=USHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
Code Examples
1
2
curl -X GET "https://api.api-ninjas.com/v1/publicholidays?country=US&year=2024" \
-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.
/v1/ispublicholiday GET
https://api.api-ninjas.com/v1/ispublicholiday
Returns whether a given date is a public holiday for a given country.
Parameters
countryrequired2-letter ISO country code.
daterequiredDate in
YYYY-MM-DDformat. Must be between1980-01-01and2050-12-31(inclusive).
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object with the following fields or an error if the request is unsuccessful.
is_public_holidayWhether the date is a public holiday.
public_holiday_nameName of the public holiday.
dateHoliday date in
YYYY-MM-DDformat.country2-letter ISO country code.
Sample Request Live Demo!
Try our APIs in the API playground
Sign up for a free API key to get started — no credit card required.
https://api.api-ninjas.com/v1/ispublicholiday?country=US&date=2025-01-01Headers
X-Api-KeyLog in or sign up to get your API KeySample Response
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 from 1980 to 2050 for over 100 countries, accepting either a 2-letter ISO country code or a full country name in thecountryparameter. 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 where the holiday is observed, and afederalflag indicating whether it is a federal holiday. 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 and is a premium-only feature, so see pricing for access. For looking up country codes and names, the Country API can help.