Skip to main content

List holidays

Introduction

Retrieves a list public holidays and observances for countries, states and provinces.

Rate limiting and throttling

We're here to support the speed of your business - there are no rate limits in place.

Usage

To list available countries, you'll need to make a request to GET /list endpoint. You can alter received response by using filters as well as premium filters.

const axios = require('axios');

axios.get('https://api.getfestivo.com/v3/public-holidays/list', {
params: {
api_key: "XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX",
country: "US",
year: 2024
}
})
.then(function (response) {
// handle success
console.log(response)
})
.catch(function (error) {
// handle error
console.log(error)
})
.then(function () {
// always executed
})

Filters

In GET query you are able to append more parameters. Some of them are required some of them are optional, but each of them alter received list of holidays a bit. Please make yourself comfortable with the list below before you start using our Public Holidays API.

ParameterRequiredDescriptionTypeExample
countryyesISO 3166-1 alpha-2 country code from Countries section.stringUS
yearyes4-digit yearint2022
monthno1 or 2 digit month identifier (MM or M)int06
dayno1 or 2 digit day identifier (DD or D)int23
publicnoReturn only public holidaysbool1

Premium filters

caution

This functionality is only available in Starter, Business and Enterprise plans.

Depending on your plan, there are some additional filters available, allowing you to return holidays & observances in a specific language, within a dates range, calculating observance dates for specific timezones, as well as allowing to filter by subdivisions.

ParameterRequiredDescriptionTypeExample
beforenoReturn only holidays before given date (default: 0)bool1
afternoReturn only holidays after given date (default: 0)bool1
formatnoDefine return data format (available: json, xml)stringjson
timezonenoConvert date and time according to passed timezone. Learn more →stringEurope/London
languagenoISO 639-1 language code (default: en). Learn more →stringen
regionsnoISO 3166-2 subdivision code. Learn more →stringGB-ENG

Languages

caution

This functionality is only available in Starter, Business and Enterprise plans.

In order to support your global operations and as a response to our growing worldwide customer base, we've introduced language support in late 2018. By passing language's ISO 639-1 code as language (or lang) parameter, you're altering the returned holiday name in holiday.name response property to your language-of-choice. List of all ISO 639-1 language codes is available here.

All languages available for specific country are listed under availableFilters.language property.

If we don't support the language you specified, we use standard English name as a fallback.

Timezones

caution

This functionality is only available in Starter, Business and Enterprise plans.

We care about you and your business and support your global operations. For this purpose, to ease you handling different holidays in different countries and timezones, we convert all dates of all holidays in response, according to the timezone parameter, of course if you'll pass it.

We support all timezones in TZ database format.

Subdivisions

caution

This functionality is only available in Business and Enterprise plans.

Usually, the countries have several levels of administrative divisions. The common names for the principal (largest) administrative divisions are: states (i.e. "federated states", rather than sovereign states), provinces, lands, oblasts, governorates, cantons, prefectures, counties, regions, departments, and emirates.

For example, while all Australian states and territories share the major public holidays, there are some differences between states and territories in what public holidays are observed and when. There are some public holidays, like Easter Sunday, that are observed in many but not all states and only one of the territories. Then there are also public holidays, like Western Australia Day, that are only celebrated by one state (guess which one). Finally, there are public holidays like Recreation Day in Tasmania that are only observed at a regional level.

At Festivo, we're collecting both national and regional level holidays and observances. You can filter them out using regions parameter that takes comma-separated list of ISO 3166-2 subdivision codes.

Substitute holidays

Depending on country, if a holiday falls on Sunday or Saturday, the holiday is legally moved to another day, usually first following working day, e.g. next Monday. This is something we call substitute holiday. Such thing happens quite often, and to save you the burden to remember about all those complicated regulations and rules that differ between country to country, we are automatically marking such holidays with substitute flag, as well as we're returning the actual date when the holiday takes place as holiday.observed property.

Please bear in mind that sometimes those rules are overly complicated and may even differ between cities or provinces of a country. In such event, we try to cover those cases, or we use the "general" rule (e.g. in Canada we may use federal-level rule over regional).

Responses

Possible HTTP response codes

Response status codes are returned as both the HTTP status code and as part of the response body.

CodeDescription
200All okay
400Validation error. Please refer to errors array available in received response.
401Authorization error. Check your api_token parameter and if you have active subscription.
402Payment Required. Upgrade your subscription plan. More information can be found in the message parameter of the response.
403Authentication error. Requested resource/feature/filter is not available for you/in your plan, or you've exceeded your monthly requests allowance.
429You've exceeded rate limit available in your plan.
500Fatal error at our end. We should get reported automatically but contact us if it'll keep occurring.

Response properties

CodeTypeDescription
statusintStatus code for the response.
queryobjectObject containing passed query details
requestIdstringUnique identifier of the request. Include this as reference when reporting issues.
holidays.countrystringISO 3166-1 alpha-2 code for the country that the holiday is for.
holidays.datedateDate that the holiday actually occurs. Alterable by timezone parameter. Format: RFC3339
holidays.enddatetimeEnd date and time in specified timezone of the holiday. Alterable by timezone parameter. Format: RFC3339
holidays.idstringUnique identifier for the holiday.
holidays.namestringName of the holiday or observance. Alterable by language parameter.
holidays.name_localstringName of the holiday or observance in the official (if available) language
holidays.observeddateDate that the holiday is observed on. Example, some countries move holidays that land on a weekend to the following Monday. Often times, this value may be the same as date.
holidays.publicboolWhether or not the holiday or observance is a public holiday.
holidays.startdatetimeStart date and time in specified timezone of the holiday. Alterable by timezone parameter. Format: RFC3339
holidays.subdivisionsarrayTable containing ISO 3166-2 codes for states or provinces that the holiday is for.
holidays.substituteboolSubstitute holiday is another working day off work that is designated to replace a public holiday.
holidays.typestringSpecific holiday type that this holiday has been recognised as.
holidays.weekday.date.namestringName of the day of the week of the holiday date.
holidays.weekday.date.numericstringName of the day of the week of the holiday date.
holidays.weekday.observed.namestringName of the day of the week holiday is observed on.
holidays.weekday.observed.numericstringNumeric representation of the day of the week holiday is observed on.

Example responses

Standard request response

Below is an example status 200 standard response returned by our API:

{
"holidays": [
{
"country": "US",
"date": "2024-01-01",
"end": "2024-01-01T23:59:59Z",
"id": "20240101_cd5f5a6c6e09cb5af81af9e87c11a34d",
"name": "New Year's Day",
"name_local": "New Year's Day",
"observed": "2024-01-01",
"public": true,
"start": "2024-01-01T00:00:00Z",
"subdivisions": [],
"substitute": false,
"type": "public",
"weekday": {
"date": {
"name": "Monday",
"numeric": 1
},
"observed": {
"name": "Monday",
"numeric": 1
}
}
},
{
"country": "US",
"date": "2024-01-15",
"end": "2024-01-15T23:59:59Z",
"id": "20240115_6613e1e09e30661cfb73cfe3409144b2",
"name": "Civil Rights Day",
"name_local": "Civil Rights Day",
"observed": "2024-01-15",
"public": true,
"start": "2024-01-15T00:00:00Z",
"subdivisions": [
"US-AZ",
"US-NH"
],
"substitute": false,
"type": "public",
"weekday": {
"date": {
"name": "Monday",
"numeric": 1
},
"observed": {
"name": "Monday",
"numeric": 1
}
}
},
...
]
}

Request using day parameter response

Below is an example status 200 response returned by our API to a single day request:

{
"holidays": [
{
"country": "US",
"date": "2024-01-01",
"end": "2024-01-01T23:59:59Z",
"id": "20240101_cd5f5a6c6e09cb5af81af9e87c11a34d",
"name": "New Year's Day",
"name_local": "New Year's Day",
"observed": "2024-01-01",
"public": true,
"start": "2024-01-01T00:00:00Z",
"subdivisions": [],
"substitute": false,
"type": "public",
"weekday": {
"date": {
"name": "Monday",
"numeric": 1
},
"observed": {
"name": "Monday",
"numeric": 1
}
}
}
]
}