Holiday API Documentation

Overview

The Holiday API allows you to retrieve information about public holidays in Germany for the current date. By specifying a federal state code, you can get holidays specific to that region.

Endpoint

GET https://holidays.woxly.de/api/feiertage/aktuellesDatum

Query Parameters

  • land (string, required): The code representing the federal state for which you want to fetch holidays.

Federal State Codes

  • NATIONAL: Nationally recognized holidays
  • BW: Baden-Württemberg
  • BY: Bavaria
  • BE: Berlin
  • BB: Brandenburg
  • HB: Bremen
  • HH: Hamburg
  • HE: Hesse
  • MV: Mecklenburg-Western Pomerania
  • NI: Lower Saxony
  • NW: North Rhine-Westphalia
  • RP: Rhineland-Palatinate
  • SL: Saarland
  • SN: Saxony
  • ST: Saxony-Anhalt
  • SH: Schleswig-Holstein
  • TH: Thuringia

How to Use the API

Step 1: Choose a Federal State Code

Select the federal state code from the list above that corresponds to the region you&aposre interested in. For example, use SL for Saarland.

Step 2: Construct the Request URL

Append the land query parameter with your chosen state code to the endpoint URL.

https://holidays.woxly.de/api/feiertage/aktuellesDatum?land=SL

Step 3: Send the HTTP GET Request

You can use any HTTP client to send the request. This can be a web browser, curl, Postman, or code in your preferred programming language.

Step 4: Receive and Parse the Response

The API will return a JSON array of holiday objects for the current date in the specified federal state.

[
  {
    "name": "German Unity Day",
    "date": "2024-10-03",
    "federal_state": "SL"
  }
]

Response Format

Each holiday object in the response array contains the following fields:

  • name (string): The name of the holiday.
  • date (string): The date of the holiday in YYYY-MM-DD format.
  • federal_state (string): The federal state code for which the holiday is relevant.

Error Handling

If the land query parameter is missing or contains an invalid state code, the API may return an error message.

{
  "error": "Invalid federal state code."
}

Usage Notes

  • Current Date Only: This endpoint provides holidays for the current date only. It does not support past or future dates.
  • Federal State Specific: Ensure you use the correct federal state code to get accurate holiday information.
  • National Holidays: Use the NATIONAL code to retrieve holidays recognized nationwide.

Example in JavaScript

fetch('https://holidays.woxly.de/api/feiertage/aktuellesDatum?land=SL')
  .then(response => response.json())
  .then(data => {
    if (data.length > 0) {
      data.forEach(holiday => {
        console.log(`Holiday: ${holiday.name} on ${holiday.date}`);
      });
    } else {
      console.log('No holidays today in SL.');
    }
  })
  .catch(error => console.error('Error fetching holidays:', error));

Troubleshooting

  • Invalid State Code: Double-check the land parameter to ensure it&aposs a valid federal state code from the list provided.
  • Network Issues: Ensure you have an active internet connection and that your network allows outbound HTTP requests.
  • API Availability: If you receive unexpected errors, the API server might be down. Try again later.

Contact and Support

For further assistance or to report issues, please contact the API provider through their official channels.