Thanks for this resource! I’m new to APIs - how would I setup the header to include this year and next year?
FYI I’m using Power Query so my current string looks like this:
= Json.Document(Web.Contents(“https://canada-holidays.p.rapidapi.com/api/v1/holidays?year=2021&federal=1”, [Headers=[#“x-rapidapi-key”=“040aa8b22fmshf3d978f9313666bp146783jsnf7e45e885309”]]))
Once I understand how to construct the request for multiple years, I’d like to replace the hard-coded value with parameter(s).
Thanks!
Join in the discussion - add comment below:
Hello!
By the “bare-metal interface”, I just mean that RapidAPI provides their own endpoints but there is probably some extra latency because they are just calling my URL behind the scenes.
If you wanted to just use “https://canada-holidays.ca/api/v1”, that might save you a hundred milliseconds or so. No need to switch if it’s working for you, but it might be slightly faster not to use it.
Paul
Hi Paul, thanks for the reply! Absolutely I can, and that is exactly what I did- 2 quick calls and an append table, and I have a nice dynamically generated table with at minimum 1 year (+ 1 day’s) holidays. My question comes mostly from this being my very first API call, and not yet having a second clue about their inner workings.
Re: “are you sure you need it?”
My application is asking “when should I schedule manufacturing work hours over the next day(s), month(s)?” So, if it’s say, December 17, I need to know if any upcoming holidays will impact product delivery expectations. If I have only till the end of the current year, I will end up allocating work to New Year’s Day and Family Day here in BC. Could I update a static table once a year? Sure but what fun would that be? And it was time for me to start playing with API’s.
And Re: “You can also use the bare-metal interface, it might save a bit of latency.” … googling “bare-metal interface”…
Cheers, and thanks again for maintaining this for some reason 😃
Jeff
Hi there,
Thanks for the question! Someone asked this on Github, and I will paste the answer below.
TL;DR, it would be a pretty big refactor for me to allow multiple years at once. Can you manage it on your end, and make multiple calls? (You can also use the bare-metal interface, it might save a bit of latency.)
Cheers,
Paul