API documentation

Geographical data

API: GeoTree/ISO

Get the geopraphic tree for all available entries of a country, based on an ISO country code (iso).

Function

This API reads the geographical tree of a country or region. This allows the geoIds required for further queries to be determined. The required parameters are `api_key` and `iso`. In addition, the output can be configured using further parameters. The parameters are passed as query parameters in the URL. Alternatively, authorisation can also take place in the header.

**Note:** The geographical tree contains all entries that result from the need to display public holidays and school holidays correctly. There is also a separate city database with additional cities that are located within our tree structure. The parameter `cities` (0/1) can be used to specify whether the city database should be included in the output of the geographical tree.


Interactive guide and OpenAPI

OpenAPI 3.0 (Swagger) – Interactive API documentation

Opens the interactive API documentation with Swagger, where you can test and explore API endpoints.

Download OpenAPI JSON specification

URL for requests

To retrieve the data, use the following URL. Please pay attention to upper case lower case.

POST / GET
https://feiertagskalender.ch/api/GeoTree/ISO/index.php

Request parameters

With the following variables you can complete the query and control the API results.

Parameter Explanation Examples
api_key
required
Your API Key api_key=abc-123-def-456
iso
required
ISO country code, 2 digits, or
Region code according to ISO 3166-2
iso=DE-BW
cities

Flag for extended export with recorded cities:

Variants:
0 = Without Cities (= default)
1 = Including Cities

&cities=1
charset

The desired coding of the response

Variants:
UTF-8 (= default)
ISO-8859-1

charset=iso-8859-1
format

The desired output format

Variants:
JSON (= default)
XML
CSV

format=xml
hl

Desired language of the output

Variants:
de = German (= default)
fr = French
it = Italian
en = English

hl=en

Examples (URL / PHP / Python / JavaScript)

Show examples

Return values of the API

The contents of the API responses result from:
- the data you have subscribed to (countries, public holidays, school holidays, calendar years)
- the officially known data of the legislators
- the availability based on our research (ACTUAL situation of our database)

Please note that the output in CSV format differs.

Array         Explanation Example
interface         Version of the API  
source: href       URL to the data source (website)  
  description       Name of the data source  
copyright href       URL to the copyright holder (website)  
  description       Designation of the copyright holder  
apiName         Identification of the API GeoTree/ISO
apiStatus description       Designation of the API status. For variants, see the Error messages active
date         Date of the data export 01.05.2025
request: iso       ISO country code, 2 digits BE
  charset       Font coding of the output utf-8
  format       Output data format json
  hl       Language of issue, according to request en
results status description     Output status. For variants, see the Error messages ok
  location       Geographical unit according to request  
    description     Designation of the geographical unit Belgium
    type     Designation of the type of geographical unit Country
    geoId     Geo-ID of the geographical unit. 3285
    iso     ISO country code, 2 digits BE
    iso-3166-2     Region code according to ISO 3166-2  
    cities     Any cities and towns covered in this region  
      description      
      cityId      
    children     Any subordinate geographical units  
      description   Designation of the geographical unit Brussels
      type   Designation of the type of geographical unit Region
      geoId   Geo-ID of the geographical unit. 3288
      iso   ISO country code, 2 digits BE
      iso-3166-2   Region code according to ISO 3166-2 BE-BRU
      cities   Any cities and towns covered in this region  
      children   Any subordinate geographical units
(up to 4 levels are possible)
array

Examples (JSON / XML / CSV)

JSON

URL:
https://www.feiertagskalender.ch/api/GeoTree/ISO/index.php?api_key=YOUR_API_KEY&iso=FR

Response from the API:

{
    "interface": "fcal API 2.02",
    "source": {
        "href": "https://feiertagskalender.ch",
        "description": "feiertagskalender.ch"
    },
    "copyright": {
        "href": "https://psc.ch",
        "description": "psc Peter Schuetz Informatik-Dienstleistungen, CH Arch"
    },
    "apiName": "GeoTree/ISO",
    "apiStatus": {
        "description": "active"
    },
    "date": "2025-02-28",
    "request": {
        "iso": "FR",
        "charset": "utf-8",
        "format": "json",
        "hl": "de"
    },
    "results": {
        "status": {
            "description": "ok"
        },
        "location": {
            "description": "Frankreich",
            "type": "Land",
            "geoId": "3079",
            "iso": "FR",
            "iso-3166-2": "",
            "cities": null,
            "children": [
                {
                    "description": "Auvergne-Rhône-Alpes",
                    "type": "Region",
                    "geoId": "3099",
                    "iso": "FR",
                    "iso-3166-2": "FR-ARA",
                    "cities": null,
                    "children": [
                        {
                            "description": "Ain",
                            "type": "Departement",
                            "geoId": "4142",
                            "iso": "FR",
                            "iso-3166-2": "FR-01",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Allier",
                            "type": "Departement",
                            "geoId": "4143",
                            "iso": "FR",
                            "iso-3166-2": "FR-03",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Ardèche",
                            "type": "Departement",
                            "geoId": "4144",
                            "iso": "FR",
                            "iso-3166-2": "FR-07",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Cantal",
                            "type": "Departement",
                            "geoId": "4145",
                            "iso": "FR",
                            "iso-3166-2": "FR-15",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Drôme",
                            "type": "Departement",
                            "geoId": "4146",
                            "iso": "FR",
                            "iso-3166-2": "FR-26",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Haute-Loire",
                            "type": "Departement",
                            "geoId": "4149",
                            "iso": "FR",
                            "iso-3166-2": "FR-43",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Haute-Savoie",
                            "type": "Departement",
                            "geoId": "4154",
                            "iso": "FR",
                            "iso-3166-2": "FR-74",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Isère",
                            "type": "Departement",
                            "geoId": "4147",
                            "iso": "FR",
                            "iso-3166-2": "FR-38",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Loire",
                            "type": "Departement",
                            "geoId": "4148",
                            "iso": "FR",
                            "iso-3166-2": "FR-42",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Métropole de Lyon",
                            "type": "Departement",
                            "geoId": "4152",
                            "iso": "FR",
                            "iso-3166-2": "FR-69",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Puy-de-Dôme",
                            "type": "Departement",
                            "geoId": "4150",
                            "iso": "FR",
                            "iso-3166-2": "FR-63",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Rhône",
                            "type": "Departement",
                            "geoId": "4151",
                            "iso": "FR",
                            "iso-3166-2": "FR-69",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Savoie",
                            "type": "Departement",
                            "geoId": "4153",
                            "iso": "FR",
                            "iso-3166-2": "FR-73",
                            "cities": null,
                            "children": null
                        }
                    ]
                },
                {
                    "description": "Bourgogne-Franche-Comté",
                    "type": "Region",
                    "geoId": "3101",
                    "iso": "FR",
                    "iso-3166-2": "FR-BFC",
                    "cities": null,
                    "children": [
                        {
                            "description": "Côte-d’Or",
                            "type": "Departement",
                            "geoId": "4207",
                            "iso": "FR",
                            "iso-3166-2": "FR-21",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Doubs",
                            "type": "Departement",
                            "geoId": "4208",
                            "iso": "FR",
                            "iso-3166-2": "FR-25",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Haute-Saône",
                            "type": "Departement",
                            "geoId": "4211",
                            "iso": "FR",
                            "iso-3166-2": "FR-70",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Jura",
                            "type": "Departement",
                            "geoId": "4209",
                            "iso": "FR",
                            "iso-3166-2": "FR-39",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Nièvre",
                            "type": "Departement",
                            "geoId": "4210",
                            "iso": "FR",
                            "iso-3166-2": "FR-58",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Saône-et-Loire",
                            "type": "Departement",
                            "geoId": "4212",
                            "iso": "FR",
                            "iso-3166-2": "FR-71",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Territoire de Belfort",
                            "type": "Departement",
                            "geoId": "4214",
                            "iso": "FR",
                            "iso-3166-2": "FR-90",
                            "cities": null,
                            "children": null
                        },
                        {
                            "description": "Yonne",
                            "type": "Departement",
                            "geoId": "4213",
                            "iso": "FR",
                            "iso-3166-2": "FR-89",
                            "cities": null,
                            "children": null
                        }
                    ]
                }
            ]
        }
    }
}

XML

URL:
https://www.feiertagskalender.ch/api/GeoTree/ISO/index.php?api_key=YOUR_API_KEY&iso=FR&format=xml

Response from the API:

<fcal_api>
<interface>fcal API 2.02</interface>
<source>
<href>https://feiertagskalender.ch</href>
<description>feiertagskalender.ch</description>
</source>
<copyright>
<href>https://psc.ch</href>
<description>psc Peter Schuetz Informatik-Dienstleistungen, CH Bern</description>
</copyright>
<apiStatus>
<description>active</description>
</apiStatus>
<apiName>GeoTree/ISO</apiName>
<date>2025-02-28</date>
<request>
<iso>FR</iso>
<charset>utf-8</charset>
<format>xml</format>
<hl>de</hl>
</request>
<results>
<status>
<description>ok</description>
</status>
<location>
<description>Frankreich</description>
<type>Land</type>
<geoId>3079</geoId>
<iso>FR</iso>
<iso-3166-2></iso-3166-2>
<cities></cities>
<children>
<child>
<description>Auvergne-Rhône-Alpes</description>
<type>Region</type>
<geoId>3099</geoId>
<iso>FR</iso>
<iso-3166-2>FR-ARA</iso-3166-2>
<cities></cities>
<children>
<child>
<description>Ain</description>
<type>Departement</type>
<geoId>4142</geoId>
<iso>FR</iso>
<iso-3166-2>FR-01</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Allier</description>
<type>Departement</type>
<geoId>4143</geoId>
<iso>FR</iso>
<iso-3166-2>FR-03</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Ardèche</description>
<type>Departement</type>
<geoId>4144</geoId>
<iso>FR</iso>
<iso-3166-2>FR-07</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Cantal</description>
<type>Departement</type>
<geoId>4145</geoId>
<iso>FR</iso>
<iso-3166-2>FR-15</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Drôme</description>
<type>Departement</type>
<geoId>4146</geoId>
<iso>FR</iso>
<iso-3166-2>FR-26</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Haute-Loire</description>
<type>Departement</type>
<geoId>4149</geoId>
<iso>FR</iso>
<iso-3166-2>FR-43</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Haute-Savoie</description>
<type>Departement</type>
<geoId>4154</geoId>
<iso>FR</iso>
<iso-3166-2>FR-74</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Isère</description>
<type>Departement</type>
<geoId>4147</geoId>
<iso>FR</iso>
<iso-3166-2>FR-38</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Loire</description>
<type>Departement</type>
<geoId>4148</geoId>
<iso>FR</iso>
<iso-3166-2>FR-42</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Métropole de Lyon</description>
<type>Departement</type>
<geoId>4152</geoId>
<iso>FR</iso>
<iso-3166-2>FR-69</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Puy-de-Dôme</description>
<type>Departement</type>
<geoId>4150</geoId>
<iso>FR</iso>
<iso-3166-2>FR-63</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Rhône</description>
<type>Departement</type>
<geoId>4151</geoId>
<iso>FR</iso>
<iso-3166-2>FR-69</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Savoie</description>
<type>Departement</type>
<geoId>4153</geoId>
<iso>FR</iso>
<iso-3166-2>FR-73</iso-3166-2>
<cities></cities>
<children></children>
</child>

</children>
</child>
<child>
<description>Bourgogne-Franche-Comté</description>
<type>Region</type>
<geoId>3101</geoId>
<iso>FR</iso>
<iso-3166-2>FR-BFC</iso-3166-2>
<cities></cities>
<children>
<child>
<description>Côte-d’Or</description>
<type>Departement</type>
<geoId>4207</geoId>
<iso>FR</iso>
<iso-3166-2>FR-21</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Doubs</description>
<type>Departement</type>
<geoId>4208</geoId>
<iso>FR</iso>
<iso-3166-2>FR-25</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Haute-Saône</description>
<type>Departement</type>
<geoId>4211</geoId>
<iso>FR</iso>
<iso-3166-2>FR-70</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Jura</description>
<type>Departement</type>
<geoId>4209</geoId>
<iso>FR</iso>
<iso-3166-2>FR-39</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Nièvre</description>
<type>Departement</type>
<geoId>4210</geoId>
<iso>FR</iso>
<iso-3166-2>FR-58</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Saône-et-Loire</description>
<type>Departement</type>
<geoId>4212</geoId>
<iso>FR</iso>
<iso-3166-2>FR-71</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Territoire de Belfort</description>
<type>Departement</type>
<geoId>4214</geoId>
<iso>FR</iso>
<iso-3166-2>FR-90</iso-3166-2>
<cities></cities>
<children></children>
</child>
<child>
<description>Yonne</description>
<type>Departement</type>
<geoId>4213</geoId>
<iso>FR</iso>
<iso-3166-2>FR-89</iso-3166-2>
<cities></cities>
<children></children>
</child>

</children>
</child>


</children>
</location>
</results>
</fcal_api>

CSV

Aufruf:
https://www.feiertagskalender.ch/api/GeoTree/ISO/index.php?api_key=YOUR_API_KEY&iso=FR&format=csv

Response from the API:

"location_L0";"type_L0";"geoId_L0";"iso_L0";"iso-3166-2_L0";"location_L1";"type_L1";"geoId_L1";"iso_L1";"iso-3166-2_L1";"location_L2";"type_L2";"geoId_L2";"location_L3";"type_L3";"geoId_L3";"location_L4";"type_L4";"geoId_L4";"cityName";"cityId"
"Frankreich";"Land";"3079";"FR";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Auvergne-Rhône-Alpes";"Region";"3099";"FR";"FR-ARA";"";"";"";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Auvergne-Rhône-Alpes";"Region";"3099";"FR";"FR-ARA";"Ain";"Departement";"4142";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Auvergne-Rhône-Alpes";"Region";"3099";"FR";"FR-ARA";"Allier";"Departement";"4143";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Auvergne-Rhône-Alpes";"Region";"3099";"FR";"FR-ARA";"Ardèche";"Departement";"4144";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Auvergne-Rhône-Alpes";"Region";"3099";"FR";"FR-ARA";"Cantal";"Departement";"4145";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Auvergne-Rhône-Alpes";"Region";"3099";"FR";"FR-ARA";"Drôme";"Departement";"4146";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Auvergne-Rhône-Alpes";"Region";"3099";"FR";"FR-ARA";"Haute-Loire";"Departement";"4149";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Auvergne-Rhône-Alpes";"Region";"3099";"FR";"FR-ARA";"Haute-Savoie";"Departement";"4154";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Auvergne-Rhône-Alpes";"Region";"3099";"FR";"FR-ARA";"Isère";"Departement";"4147";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Auvergne-Rhône-Alpes";"Region";"3099";"FR";"FR-ARA";"Loire";"Departement";"4148";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Auvergne-Rhône-Alpes";"Region";"3099";"FR";"FR-ARA";"Métropole de Lyon";"Departement";"4152";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Auvergne-Rhône-Alpes";"Region";"3099";"FR";"FR-ARA";"Puy-de-Dôme";"Departement";"4150";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Auvergne-Rhône-Alpes";"Region";"3099";"FR";"FR-ARA";"Rhône";"Departement";"4151";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Auvergne-Rhône-Alpes";"Region";"3099";"FR";"FR-ARA";"Savoie";"Departement";"4153";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Bourgogne-Franche-Comté";"Region";"3101";"FR";"FR-BFC";"";"";"";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Bourgogne-Franche-Comté";"Region";"3101";"FR";"FR-BFC";"Côte-d’Or";"Departement";"4207";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Bourgogne-Franche-Comté";"Region";"3101";"FR";"FR-BFC";"Doubs";"Departement";"4208";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Bourgogne-Franche-Comté";"Region";"3101";"FR";"FR-BFC";"Haute-Saône";"Departement";"4211";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Bourgogne-Franche-Comté";"Region";"3101";"FR";"FR-BFC";"Jura";"Departement";"4209";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Bourgogne-Franche-Comté";"Region";"3101";"FR";"FR-BFC";"Nièvre";"Departement";"4210";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Bourgogne-Franche-Comté";"Region";"3101";"FR";"FR-BFC";"Saône-et-Loire";"Departement";"4212";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Bourgogne-Franche-Comté";"Region";"3101";"FR";"FR-BFC";"Territoire de Belfort";"Departement";"4214";"";"";"";"";"";"";"";""
"Frankreich";"Land";"3079";"FR";"";"Bourgogne-Franche-Comté";"Region";"3101";"FR";"FR-BFC";"Yonne";"Departement";"4213";"";"";"";"";"";"";"";""

Error messages

Output location Error message Explanation
results: status:
results: status: description unknown location The requested ISO country code is not known.
Please check the parameter ISO
apiStatus
apiStatus: description invalid usage The use of this API is not enabled for this user.
apiStatus: description invalid key Invalid API key.
apiStatus: description invalid referer Invalid access. Links from web pages (front-ends) are not allowed.
apiStatus: description inactive The API has not yet been activated for use.
apiStatus: description expired The period of use according to the contract has expired.
© 2003 - 2025 psc Peter Schütz Informatik Dienstleistungen, CH-Arch