Deutsche Feiertage API / PHP / Javascript / jQuery

Updates / Changes

Any wishes / suggestions / feature requests?
Fragen / Wünsche / Anregungen? here / hier

Example Outputs / Ausgabe Beispiele

Ist heute ein Feiertag / Is today a public holiday in Germany:


Ist heute ein Feiertag + Info / Is today a public holiday in Germany? + info:


Nächster Feiertag / Next public holiday in Germany:


Ist heute Sonntag / Is today a sunday:


Liste der Feiertage / List if public holidays as JSON Response

Liste der Feiertage / List if public holidays

Options / Optionen

QeryType / Abfragetyp ?a=

Code Examples / Beispiele



        /*
         * Javascript / jQuery
         * url: https://ipty.de/feiertag/api.php


         * do: isFeiertag (returns 0 oder 1)
         * datum: zb: 01.01.2024  (Format: TT.MM.JJJJ)


         * do: isSunday / isSonntag (returns 0 oder 1)
         * datum: zb: 01.01.2024 (Format: TT.MM.JJJJ)


         * do: getFeiertage (returns json array)
         * jahr: zb: 2024

         * do: nearestFeiertag (returns json array)
         * outformat: zb. Y-m-d Ausgabeformat des Datums. Standard is d.m.Y [entpricht: TT.MM.JJJJ])


         *  loc: "BW,BY,BE,BB,HB,HH,HE,MV,NI,NW,RP,SL,SN,ST,SH,TH"

            [
            Bundesländer
            BW - Baden-Würtemberg
            BY - Bayern
            BE - Berlin
            BB - Brandenburg
            HB - Bremen
            HH - Hamburg
            HE - Hessen
            MV - Mecklenburg-vorpommern
            NI - Niedersachsen
            NW - Nordrhein-Westfalen
            RP - Rheinland-Pfalz
            SL - Saarland
            SN - Sachsen
            ST - Sachsen-Anhalt
            SH - Schleswig-Holstein
            TH - Thüringen
            ]
         * loc: weg lassen = alle  Bundesländer
         * Optional:
         *
         * outformat: zb. Y-m-d Ausgabeformat des Datums. Standard is d.m.Y
         *
         * ACHTUNG! Führende Nullen benutzen: 1.1.1998 => 01.01.1998
        */

        /* Simple Examples / Einfache Beispiele */

        /* Ist das angegebe Datum ein Feiertag + Info */
        $(document).ready(function () {
                let now = new Date();
                let day = ("0" + now.getDate()).slice(-2);
                let month = ("0" + (now.getMonth() + 1)).slice(-2);
                let today = (day) + "." + (month) + "." + now.getFullYear();
                $.get("https://ipty.de/feiertag/api.php", {
                    'do': "isFeiertagInfo",
                    'datum': today, /* oder zb. '14.04.2016' */
                    'outformat': "d.m.Y",
                    'loc': "BW,BY,BE,BB,HB,HH,HE,MV,NI,NW,RP,SL,SN,ST,SH,TH"
                })
                    .done(function (data) {
                        let d = $.parseJSON(data)
                        if ('0' == d['isFeiertag']) {
                            $('#istfeiertaginfo').html(d);
                        }
                        if ('1' == d['isFeiertag']) {
                            $('#istfeiertaginfo').html(d['datum'] + ' / ' + d['title'] + ' / ' + d['locs']);
                        }
                    }) , "json"
            }
        );
        /* Ist HEUTE ein Sonntag  */
        $(document).ready(function () {
                let now = new Date();
                let day = ("0" + now.getDate()).slice(-2);
                let month = ("0" + (now.getMonth() + 1)).slice(-2);
                let today = (day) + "." + (month) + "." + now.getFullYear();
                $.get("https://ipty.de/feiertag/api.php", {
                    'do': "isSunday",
                    'datum': today,
                })
                    .done(function (data) {
                        if ('0' == data) {
                            $('#istsonntag').html(data);
                        }
                        if ('1' == data) {
                            $('#istsonntag').html(data);
                        }
                    });
            }
        );
        /* Ist HEUTE ein Feiertag */
        $(document).ready(function () {
                let now = new Date();
                let day = ("0" + now.getDate()).slice(-2);
                let month = ("0" + (now.getMonth() + 1)).slice(-2);
                let today = (day) + "." + (month) + "." + now.getFullYear();
                $.get("https://ipty.de/feiertag/api.php", {
                    'do': "isFeiertag",
                    'datum': today,
                    'loc': "BW,BY,BE,BB,HB,HH,HE,MV,NI,NW,RP,SL,SN,ST,SH,TH"
                })
                    .done(function (data) {
                        if ('0' == data) {
                            $('#istfeiertag').html('NEIN');
                        }
                        if ('1' == data) {
                            $('#istfeiertag').html('JA');
                        }
                    });
            }
        );
        /* Ist Naechster Feiertag */
        $(document).ready(function () {
                $.get("https://ipty.de/feiertag/api.php", {
                    'do': "nearestFeiertag",
                    'loc': "BW,BY,BE,BB,HB,HH,HE,MV,NI,NW,RP,SL,SN,ST,SH,TH",
                    'outformat': "d.m.Y"
                })
                    .done(function (data) {
                        let d = JSON.parse(data);
                        $('#naechsterfeiertag').html((d[0]["date"] + ' / ' + d[0]["tagName"] + ' / ' + d[0]["title"] + ' in ' + d[0]["locs"]));
                    });
            }, "json"
        );
        /*Hole alle Feiertage des Jahres*/
        $(document).ready(function () {
                $.get("https://ipty.de/feiertag/api.php", {
                        'do': "getFeiertage",
                        'jahr': "2024",
                        'outformat': "Y-m-d",
                        'loc': "BW,BY,BE,BB,HB,HH,HE,MV,NI,NW,RP,SL,SN,ST,SH,TH"
                    }
                )
                    .done(function (data) {
                        $('#feiertagsliste').html(data);
                    });
            }, "json"
        );


    
    

API, GET, Browser examples / Beispiele


    /*
    * php / api call / browser
    *
    /* Ist das angegebe Datum ein Feiertag + Informationen */
    /* Is the given date a public holiday + information */

    GET: https://ipty.de/feiertag/api.php?do=isFeiertagInfo&datum=25.12.2024&loc=BW,BY,BE,BB,HB,HH,HE,MV,NI,NW,RP,SL,SN,ST,SH,TH&outformat=d.m.Y

    /* Ist das angegebe Datum ein Feiertag */
    /* Is the given day a public holiday */
    GET: https://ipty.de/feiertag/api.php?do=isFeiertag&datum=25.12.2024&loc=SN,BY

    /* Hole alle Feiertage des Jahres */
    /* Get all public holdays for the given year */
    GET: https://ipty.de/feiertag/api.php?do=getFeiertage&loc=SN,BY,BW,BB&outformat=Y-m-d&jahr=2024
    /* Hole nächstfolgenden Feiertage des Jahres zum aktuellen Datum */
    /*  Get the next public holiday after the given date */
    GET: https://ipty.de/feiertag/api.php?do=nearestFeiertag&outformat=d.m.Y

    /* Ist das angegebene Datum ein Sonntag */
    /* Is the given date a sunday */
    GET: https://ipty.de/feiertag/api.php?do=isSunday&datum=11.07.2024



! Alle Angaben/Ausgaben ohne Gewähr !