Retrieve Public Holidays for a Country in Java

Ensure you stay informed and prepared for the contingencies surrounding international commerce. Differing holidays, celebrations, and other recognized days throughout the year may impact not only any employees who live in those areas, but also your approach to sales, marketing, and planning and how your business should use this fore knowledge to your advantage. The following API will populate a list of public holidays for a given country so you can better plan your year.

Image for post
Image for post

To install with Maven, add a reference to the repository in pom.xml:


And add a reference to the dependency in pom.xml:


To install with Gradle, add it in your root build.gradle at the end of repositories:

allprojects {
repositories {
maven { url '' }

And add the dependency in build.gradle:

dependencies {
implementation 'com.github.Cloudmersive:Cloudmersive.APIClient.Java:v3.54'

Then, call the function:

// Import classes:
//import com.cloudmersive.client.invoker.ApiClient;
//import com.cloudmersive.client.invoker.ApiException;
//import com.cloudmersive.client.invoker.Configuration;
//import com.cloudmersive.client.invoker.auth.*;
//import com.cloudmersive.client.DateTimeApi;

This will return the name of the holiday in both English and the local language, as well as the date on which it occurs, the holiday type, and whether the holiday is nationwide. You can retrieve the API Key from the Cloudmersive website at no cost and with no commitment. This will provide you with 800 monthly calls across our library of APIs.

Written by

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store