Documentation

Learn to use the API

Download Wrapper

Documentation

Parameters

Name Example Mandatory Description
country PL Yes ISO 3166-1 alpha-2 format (BE, BR, CA, CZ, DE, FR, GB, NO, PL, SK, SL, ID, US)
year 2018 Yes ISO 8601 format (CCYY)
month 4 or 04 No 1 or 2 digit month (1-12)
day 7 or 07 No 1 or 2 digit day (1-31 depending on the month)
previous true No boolean; returns the previous holidays based on the date (works with all parameters listed before)
upcoming true No boolean; returns the previous holidays based on the date (works with all parameters listed before except previous)
pretty true No boolean; prettifies returned JSON for a better human reading performance

Basic Usage

curl https://holidayapi.pl/v1/holidays
-XGET
-d"country=PL&year=2018"

Specific day and month example

curl https://holidayapi.pl/v1/holidays
-XGET
-d"country=PL&year=2018&day=25&month=12"

Upcoming holidays

curl https://holidayapi.pl/v1/holidays
-XGET
-d"country=PL&year=2018&month=12&day=14&upcoming=true"

Past holidays

curl https://holidayapi.pl/v1/holidays
-XGET
-d"country=PL&year=2018&month=12&day=14&previous=true"

jQuery example

You can use the standard jQuery get() method to perform a GET request and obtain the data you desire:

// https://api.jquery.com/jquery.get/
let url = 'https://holidayapi.pl/v1/holidays?country=US&year=2018&month=12';
$.get( url, function( data ) {
  // log response to the console
  console.log(data);
  alert( "Done!" );
});
});

Obviously, you can always use the jQuery ajax() or get() method to access

$.ajax({
  url: 'https://holidayapi.pl/v1/holidays',
  data: {country: 'US', year: '2018', month: '12'},
  success: function(data) {
    // do something with the response
    console.log(data);
  },
  dataType: 'json'
});

Remember, with Holiday API your possibilities are endless. Only your imagination is the limit.

Adding new countries

I work hard on adding new countries and keeping everything up to date, but I'm also busy with other projects and professional and family life.

If you would like to help adding your country's holidays to expand the service, please do not hesitate to contact me by droping an email on [email protected].

Together we're strong! You can also help me maintain this project and keep it free of charge by donating any amount.