TL;DR
The Non-working Days API helps determine whether a specific date is a working day, weekend, or public holiday for any supported country. It also provides bulk holiday lists by year/country and working day counts between two dates. Essential for business applications dealing with deadlines, billing cycles, and scheduling across different jurisdictions.
Quick start: https://nonworkingdays.com/api/isnonworkingday?date=2024-01-01&country=US
No API key needed — just make a request!
How to Use This API
1. Check if a Date is a Non-Working Day
https://nonworkingdays.com/api/isnonworkingday?date=2024-12-25&country=US
Returns whether the date is a non-working day, holiday name if applicable, and the day of week.
2. Get All Holidays for a Year
https://nonworkingdays.com/api/holidays?country=GB&year=2024
Returns all public holidays for a given country and year with holiday names and dates.
3. Count Working Days Between Dates
https://nonworkingdays.com/api/workingdays?country=US&start=2024-01-01&end=2024-01-31
Counts the number of working days (Monday-Friday excluding holidays) in a date range.
4. JavaScript — Deadline Calculator
async function countWorkingDays(startDate, endDate, country) {
const resp = await fetch(
`https://nonworkingdays.com/api/workingdays` +
`?country=${country}&start=${startDate}&end=${endDate}`
);
const data = await resp.json();
return data.workingDays;
}
async function checkDeadline() {
const days = await countWorkingDays('2024-01-01', '2024-01-15', 'US');
console.log(`Working days between Jan 1-15: ${days}`);
// Returns working days (Mon-Fri excluding holidays like New Year's Day)
}
checkDeadline();
5. Python — Holiday Calendar Generator
import requests
from datetime import datetime
def get_holidays(country, year):
resp = requests.get(
'https://nonworkingdays.com/api/holidays',
params={'country': country, 'year': year}
)
data = resp.json()
print(f"Public holidays in {country} for {year}:")
for h in data.get('holidays', []):
date = datetime.strptime(h['date'], '%Y-%m-%d')
print(f" {date.strftime('%b %d')}: {h['name']}")
return data.get('holidays', [])
get_holidays('FR', 2024)
https://nonworkingdays.com/api/holidays?country=US&year=2024
Frequently Asked Questions
- What countries are supported?
- 50+ countries including US, UK, Canada, Australia, Germany, France, Japan, India, Brazil, and many more. Country codes use ISO 3166-1 alpha-2 format.
- How are weekends handled?
- Default is Saturday-Sunday weekend. Some countries with different work weeks (e.g., Friday-Saturday in Middle Eastern countries) are supported with the
workWeekparameter. - Are regional holidays included?
- Yes, many countries have region-specific holidays. The API supports state/province filters via the
regionparameter (e.g.,region=CA-ONfor Ontario). - What information is returned per holiday?
- Holiday name, date, country, region (if applicable), and type (public, observance, bank holiday).
- Is the data updated yearly?
- Yes, the holiday database is kept current. Future years may have provisional entries that are updated as governments announce holiday schedules.
API Details
- API URL
https://nonworkingdays.com/api- Documentation
- nonworkingdays.com
- Category
- Date
- Authentication
- Not Required
- Geographic Coverage
- 50+ Countries worldwide
What You Can Build
- Business deadline calculator that skips holidays and weekends
- Payroll scheduling system with country-specific work calendars
- International project timeline planner across multiple countries
- Holiday countdown widget for any country
- Invoice due date calculator considering local holidays