I’m looking for a Make.com app (preferably free) or solution that I can use to get the current date and determine if it is a holiday, from a universal holiday calendar or similar without having to compile a list of holidays myself.
Any ideas?
Hello @markyodoai
First, you need to define your holiday year and country. Every country has differences on it. Important is we should need to find a list of holiday dates.
Just search on any search engine about it. There are lots of specific public or paid APIs available. One example I’ve found is Public Holiday Api - Nager.Date, check if it fits on your list.
After selecting the API for a list of dates then it will be easy.
There are 2 ways.
- Using Iterator
- Using
map()
function.
Iterator
→ Get the list of dates using the HTTP module
→ Aggregate it using Array Aggregator(if needed)
→ Iterate it using the Iterator module.
→ Use the router module to check and separate the is_holiday or not_holiday using filters.
→ Just for testing purposes add a set variable module in every route, and set value accordingly.
map()
function
This is the simplest version but is hard to understand if you don’t know the get()
and map()
functions.
→ Get the list of dates using the HTTP module
→ Then use a set of multiple variable modules to easily identify whether today is a holiday or not.
The formula for setting multiple variables
{{contains(map(1.data; "date"); formatDate(now; "YYYY-MM-DD"))}}
is_holiday
returns true
OR false
P.S.: Always search first, Check Make Academy. If this is helpful, Mark Best Answers as Solutions
and give
If you need expert help or have questions? Contact or comment below!
Welcome to the Make community!
You can also find more relevant APIs on RapidAPI:
e.g.: holiday APIs (Free Tutorials, SDK Documentation & Pricing)
How to call an API on RapidAPI
Use the HTTP “Make an API Key Auth Request” module.
Create a new keychain connection and insert your RapidAPI API Key.
Key: <YOUR_RAPIDAPI_KEY>
API Key parameter name: X-RapidAPI-Key
You can reuse this RapidAPI keychain for all API calls to RapidAPI – you’ll just need to change the X-RapidAPI-Host
value based on the API you are calling.
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.
Just curious how you know that any RapidAPI is reliable for long term use? I went through the list and some had free limits for basic account but the range was crazy, between 3 and 300 free requests.
Thank you the map () function was very easy with your helpful examples. I do have a followup question.
Why does explicitly using 7.Data.date not work in the formula?
This is the working formula.
{{contains(map(7.data; “date”); formatDate(now; “YYYY-MM-DD”))}}
Thanks.
Hey @markyodoai
Can you please share your screenshot with implementation of input that you’ve used?
@dilipborad Not sure how to share screen shot in the community but I can provide details.
I have changed the HTTP input to use Holiday API Documentation - Calendarific because it has a more complete list of holidays and generous API usage.
My input is:
https://calendarific.com/api/v2/holidays?&api_key=thisismysecretapikey&country=US&year=2024&location=all
-
The json output for specifically the date looks like this.
{{7.data.response.holidays[].date.iso}}
where date format = YYYY-MM-DD
Data -Collection -
meta -Collection
-
response -Collection
- holidays -Array
- 1 -Collection
- name
- description
- country -Collection
- date -Collection
- iso 2024-01-01
- datetime -Collection
- type -Array
- 1 -Collection
- holidays -Array
-
If I try and use the formula below it does not error but also is not getting holiday date from the array. isHoliday: false should be true based on the dataset.
{{contains(map(7.data.response.holidays[]; "date"); formatDate(now; "YYYY-MM-DD"))}}
I am now researching how to format this so it will get the date from date.iso.
I used chatgpt to help me with this one. The working formula looks like this:
{{contains(join(map(7.data.response.holidays; “date.iso”); “,”), formatDate(now; “YYYY-MM-DD”))}}
Summary:
map(7.data.response.holidays; "date.iso")
: Targets the correct nestediso
date.join(..., ",")
: Converts the array into a string for searching.formatDate(now; "YYYY-MM-DD")
: Formats the current date for comparison.
Thanks for your help today.
@dilipborad Just an update for end of day. I finished my first scenario. It was fun, a bit challenging because Make is missing some string functions so some work arounds required.
Scenario gets list of holidays from calendarific.com (generous 500 calls per month free) and checks to see if today is a holiday. It will stop if it’s not so as not to waste credits.
Then it Flow Control / Iterator to get a list of just the dates and holiday names. Finds the holiday name with a variable then filters to just the holiday name result that exists. Stores the holiday name to a variable, then parses the date to a friendly format. It then passes these 2 variables to ChatGPT with a clever prompt to create a list of 5 unexpected historical facts about the holiday and drafts a witty but informational post with introduction, facts, jokes, etc.
So many ideas now that I have my first automation done.
Thanks for your help.