DEV Community

César Freitas
César Freitas

Posted on

Check if a date is a public holiday in any country via API

Checking if a Date is a Public Holiday in Any Country via API

As developers, we often encounter scenarios where we need to check if today's date is a public holiday in any country. This can be particularly useful for applications such as scheduling tools, travel websites, or social media platforms that require users to know about upcoming holidays.

However, this task can be time-consuming and labor-intensive if done manually, especially when dealing with multiple countries. In reality, most of us would rather focus on building our application's core features rather than spending hours researching public holidays for each country.

That's where the Finance, Holidays & OG Image Tools API comes in – a lightweight API that offers a comprehensive set of tools to help developers like you solve this problem efficiently.

How Does It Work?

The Finance, Holidays & OG Image Tools API is designed to provide access to financial data, public holidays by country, loan and compound-interest calculators, as well as dynamic Open Graph social-image generation. This means that with a single API call, you can get the information on whether today's date is a public holiday in any given country.

The API is built with simplicity and flexibility in mind, allowing developers to easily integrate it into their applications without requiring extensive knowledge of holidays or financial data.

Typical Request/Response

When making a request to the Finance, Holidays & OG Image Tools API, you'll provide the date you want to check for public holidays (in ISO 8601 format) along with the country code. The response will contain an array of holiday objects, each including details such as the name of the holiday, start and end dates, and a boolean indicating whether the date is a public holiday.

For example, if you request the public holidays for January 1st in the United States (US), the API might respond with:

In this example, the API indicates that January 1st is a public holiday in the United States (US), while January 16th is also a public holiday.

Try It Out

If you're looking for an efficient and reliable way to check if today's date is a public holiday in any country, we recommend checking out the Finance, Holidays & OG Image Tools API on RapidAPI. With their free tier available, you can start experimenting with the API without incurring costs or worrying about rate limits.

By leveraging this API, you'll be able to focus on building your application's core features and leave the task of researching public holidays to the experts – saving you time, effort, and resources in the process.

Quick example

curl -X GET 'https://finance-holidays-and-og-image-tools.p.rapidapi.com/holidays?country=US&year=2026' \
  -H 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
  -H 'X-RapidAPI-Host: finance-holidays-and-og-image-tools.p.rapidapi.com'
Enter fullscreen mode Exit fullscreen mode

Try it: the Finance, Holidays & OG Image Tools API is live on RapidAPI with a free tier — get your key here.

Top comments (0)