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.
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.
country
required2-letter ISO country code or full country name.
year
optionalpremium onlyCalendar year between 1980
and 2050
(inclusive). Defaults to current year.
X-Api-Key
requiredAPI Key associated with your account.
The response will be a JSON object with the following fields:
name
Holiday name.
local_name
Local holiday name. This is often (but not always) the same as the name.
date
Holiday date.
country
2-letter ISO country code.
year
Calendar year.
regions
List of regions where the holiday is observed.
federal
Whether the holiday is a federal holiday.
https://api.api-ninjas.com/v1/publicholidays?country=US
Headers
X-Api-Key
Log in or sign up to get your API Key
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[
{
"name": "New Year's Day",
"local_name": "New Year's Day",
"date": "2025-01-01",
"country": "US",
"year": 2025,
"regions": [],
"federal": true
},
{
"name": "Martin Luther King, Jr. Day",
"local_name": "Martin Luther King, Jr. Day",
"date": "2025-01-20",
"country": "US",
"year": 2025,
"regions": [],
"federal": true
},
{
"name": "Presidents Day",
"local_name": "Washington's Birthday",
"date": "2025-02-17",
"country": "US",
"year": 2025,
"regions": [],
"federal": true
},
...
]
1
2
3
4
5
6
7
8
9
import requests
country = 'US' # United States
year = '2025'
api_url = 'https://api.api-ninjas.com/v1/publicholidays?country={}&year={}'.format(country, year)
response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'})
if response.status_code == requests.codes.ok:
print(response.text)
else:
print("Error:", response.status_code, response.text)
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/publicholidays
Returns whether a given date is a public holiday for a given country.
country
required2-letter ISO country code.
date
requiredDate in YYYY-MM-DD
format. Must be between 1980-01-01
and 2050-12-31
(inclusive).
X-Api-Key
requiredAPI Key associated with your account.
The response will be a JSON object with the following fields:
is_public_holiday
Whether the date is a public holiday.
public_holiday_name
Name of the public holiday.
date
Holiday date in YYYY-MM-DD
format.
country
2-letter ISO country code.
https://api.api-ninjas.com/v1/ispublicholiday?country=US&date=2025-01-01
1
2
3
4
5
6
{
"date": "2025-01-01",
"country": "US",
"is_public_holiday": true,
"public_holiday_name": "New Year's Day"
}