Ask A Question

Notifications

You’re not receiving notifications from this thread.

Good public national holidays api?

Andrei Crudu asked in General

I am working on a project and I need an api from which to import all the national holidays for a certain country and even for specific regions in that country.

So for example I could import all the holidays for 2015 for the USA or select to import all the holidays for the New York state in 2015 - which would include all the national holidays plus those specific to New York.

Any recommendations on a good and stable holiday api would be more than appreciated.

Thanks.

Reply

I haven't actually used any APIs for this in the past, but found a good list of them here: http://stackoverflow.com/questions/14203708/is-there-a-comprehensive-api-or-json-xml-list-with-public-bank-holidays-worldwid

It looks like the most reliable one will be the timeanddate.com one, but it's $100/yr to use. I'm sure it costs money because they actually support it well compared to the others.

http://holidayapi.com/ is another that might be alright, but someone said it didn't work correctly when they tried it a while back. Maybe it's working better now though!

Reply

What did you use in the past. I am also looking at the holidays gem: https://rubygems.org/gems/holidays Looks pretty good and it has all the stuff I would need to define my own holidays.

The problem is that I'm not looking for holidays in the US which are all over the place. I am looking for a way of getting my hands on holidays for smaller European countries and some of the big ones too, and I especially need a way of getting my hands on the holidays that will happen in the future.

I thought about using the google calendar api but that works only with my own calendars and they seem to be missing some holidays. Manually inserting holidays in a google calendar just to fetch them doesn't appeal to me.

If you could tell me what you have used in the past, that would be awesome.

By the way ... I really like what you are doing here and the fact that you are active in the forum is awesome.

Reply

That gem looks great. Might be your simplest solution as well. Google Calendar API sounds like it's not always the most accurate according to StackOverflow. I imagine that Wikipedia's list of holidays for countries is pretty accurate, but you'd have to scrape them periodically in order to get any changes.

The stuff I've done in the past was just simple and was for the US only so I haven't had any experience with the smaller EU countries which will be the ones that will give you the most trouble I'm sure. I'd try this gem and worst case you may have to add some data to the yaml files in there.

I can imagine since this is pretty hard to do, that's why the one API can cost $100/yr. That's really not too bad considering all the work they probably have to do to continuously update it. Too bad there isn't a simpler, free option that's always up-to-date!

Thanks for the kind words! :) I'm glad you're enjoying it.

Reply

Thanks for the help. Really appreciate it.

Reply

Nation specific for Germany you could try a REST Service
www.smart-webservice.com

Considering also very region specifiy german banking holiday based on postal codes, bundeslaender / states.

Reply

You can use Calendarific for this. https://calendarific.com provides a free JSOn API for holidays for over 230 countries around the world. It provides both historical and future data points.

Calendarific provides a rubygem that can be used directly within the application:
https://rubygems.org/gems/ruby-calendarific

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,464+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.