:earth_americas: Worldwide public holiday


Build status

📆 Nager.Date - Official Website

Nager.Date is a popular project to query holidays. We currently support over 100 countries.

The project is based on .NET and provides a public REST Api for accessing the data.

A docker container or a NuGet package is also available, but for this you need a license key.
You can find an overview of the supported countries here.

How can I use it?

Using the Swagger definition, they can have a client created for their programming language. You can find the information in our Api section.
More Informations about client generation you can find here


.NET/C# (click to expand)
using System;
using System.Net.Http;
using System.Text.Json;

var jsonSerializerOptions = new JsonSerializerOptions { PropertyNameCaseInsensitive = true };

using var httpClient = new HttpClient();
var response = await httpClient.GetAsync("");
if (response.IsSuccessStatusCode)
    using var jsonStream = await response.Content.ReadAsStreamAsync();
    var publicHolidays = JsonSerializer.Deserialize<PublicHoliday[]>(jsonStream, jsonSerializerOptions);

class PublicHoliday
    public DateTime Date { get; set; }
    public string LocalName { get; set; }
    public string Name { get; set; }
    public string CountryCode { get; set; }
    public bool Fixed { get; set; }
    public bool Global { get; set; }
    public string[] Counties { get; set; }
    public int? LaunchYear { get; set; }
    public string[] Types { get; set; }
PHP (click to expand)

This example use the guzzle project

require_once 'vendor/autoload.php';
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', '');
if ($response->getStatusCode() == 200) {
    $json = $response->getBody();
JAVA (click to expand)

This example use the springframework. Code tested with

import java.util.*;
import org.springframework.web.client.RestTemplate;

public class Main {
    public static void main(String[] args) {
      String json = new RestTemplate().getForObject("", String.class);
      JsonElement rootJsonElement = new JsonParser().parse(json);
      JsonArray publicHolidays = rootJsonElement.getAsJsonArray();
      Iterator<JsonElement> iterator = publicHolidays.iterator();
      while (iterator.hasNext()) {
        JsonElement publicHoliday = (JsonElement);


apply plugin:'application'
mainClassName = 'Main'

run { standardInput = }
sourceSets { main { java { srcDir './' } } }

repositories {

dependencies {

For our sponsors, we also offer a Docker container and a NuGet package

With a sponsorship you get the license key to use the variants locally without a dependency to our REST Api.


The nuget package is available via NuGet

PM> install-package Nager.Date
Code Examples (click to expand)

Examples for .NET (nuget package)

Set the license key

DateSystem.LicenseKey = "LicenseKey1234";

Get all publicHolidays of a country and year

var publicHolidays = DateSystem.GetPublicHolidays(2021, "DE");
foreach (var publicHoliday in publicHolidays)
    //publicHoliday.Date -> The date
    //publicHoliday.LocalName -> The local name
    //publicHoliday.Name -> The english name
    //publicHoliday.Fixed -> Is this public holiday every year on the same date
    //publicHoliday.Global -> Is this public holiday in every county (federal state)
    //publicHoliday.Counties -> Is the public holiday only valid for a special county ISO-3166-2 - Federal states
    //publicHoliday.Type -> Public, Bank, School, Authorities, Optional, Observance

Get all publicHolidays for a date range

var startDate = new DateTime(2016, 5, 1);
var endDate = new DateTime(2021, 5, 31);
var publicHolidays = DateSystem.GetPublicHolidays(startDate, endDate, CountryCode.DE);
foreach (var publicHoliday in publicHolidays)

Check if a date is a public holiday

var date = new DateTime(2021, 1, 1);
if (DateSystem.IsPublicHoliday(date, CountryCode.DE))
    Console.WriteLine("Is public holiday");

Check if a date is a weekend day

var date = new DateTime(2021, 1, 1);
if (DateSystem.IsWeekend(date, CountryCode.DE))
    Console.WriteLine("Is weekend");


If high availability is important for you and you want to avoid access to the Internet, we can also offer you your own Docker container.

The docker container is available via Docker Hub

To run a local instance of the docker image run the following command

docker run -p 80:80 nager/nager-date

Areas of Application

  • telephone systems
  • carrier (land transport)
  • time recording

Blog Posts

Mark Seemann - Simple holidays

Alternative projects

Language Project Supported Countries (January 2019)
PHP yasumi 34
JavaScript date-holidays 142
Java jollyday 64
.NET Holiday 21
Python python-holidays 34
Python workalendar 59