API documentation

Daily data

Read out day status by date

Daily information whether there is a public holiday and/or school holidays on this date.

API: CheckDate/CityId

Chapters:

API: CheckDate/CityId

Function

Enables queries using City-ID (ID from Feiertagskalender.ch) and date. Indicates whether and to what percentage a public holiday applies on this day, or whether there are school holidays.

The available City-IDs can be found in the API: GeoTree/ISO

URL for requests

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

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
cityId
required
City-ID of the desired locality. The City-ID of Feiertagskalender.ch &cityid=88
date

Date of the requested data
without specification: today (= default)

&date=2024-05-16
class
or
klasse

Scope of the data

Variants:
0 = school holidays only
3 = 0 + public holidays recognised by law
4 = 0 + 3 + public and non-statutory holidays (religious, cultural) (= default)
5 = 0 + 3 + 4 + event days (e.g. Valentine's Day, Mother's Day, Advent Sundays)

&klasse=5
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
date_format

The desired date format
The format corresponds to the date formatting of the PHP instruction date()

Variants:
Y-m-d = YYYY-MM-DD (ISO-8601) (= default)
d.m.Y = DD.MM.YYYY
Ymd = YYYYMMDD
dmY = DDMMYYYY
d.m.y = DD.MM.YY
j.n.y = D.M.YY

&date_format=d.m.Y
hl

Desired language of the output

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

&hl=en

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 CheckDate/CityId
apiStatus description       Designation of the API status. For variants, see the Error messages active
date         Date of the data export 16.04.2024
request: cityId       City-ID according to request 88
  date       Date of the data in the output 2019-04-18
  charset       Font coding of the output utf-8
  format       Output data format json
  date_format       Output date format d.m.Y
  hl       Language of issue, according to request en
results status description     Output status. For variants, see the Error messages ok
  location description     Designation of the geographical unit Berlin
    type     Designation of the type of geographical unit Stadt
    cityId     Geo-ID of the geographical unit. 88
    iso     ISO country code, 2 digits DE
    iso-3166-2     Region code according to ISO 3166-2 DE-BE
    note     Special notes NEW 30.03.2023
    date_status     Day status  
      date   Date 2019-04-18
      total_population   Total number of inhabitants 3601131
      public_holiday_population   Number of inhabitants with public holiday 0
      public_holiday_percent   Percent Inhabitants with public holiday 0
      public_holiday_description   Designation of the public holiday
      school_holiday_population   Number of inhabitants with school holidays 3601131
      school_holiday_percent   Percent Inhabitants with school holidays 100
      school_holiday_description   Designation school holidays Osterferien
      sum_population   Total number of inhabitants affected 3601131
      percent_population   Percentage of inhabitants affected 100

Error messages

Output location Error message Explanation
results: status:
results: status: description not subscribed You have not subscribed to the desired data.
Please contact our support.
results: status: description unknown location The requested City-ID is not known.
Please check the parameter cityId
apiStatus
apiStatus: description invalid usage The use of this API is not activated for you.
Please contact our support.
apiStatus: description invalid key Invalid API key.
Please check your API key.
apiStatus: description invalid referer Invalid access. Links from web pages (front-ends) are not allowed.
Set up your query so that it comes from a protected back-end.
If necessary, contact our support.
apiStatus: description inactive The API has not yet been activated for you to use.
Please try again at a later date.
apiStatus: description expired The period of use according to the contract has expired.
Contact our administration for a contract extension.

Examples

JSON

URL:
https://feiertagskalender.ch/api/CheckDate/CityId/?api_key=YOUR_API_KEY&cityId=88&date=2019-04-18

Response from the API:

{
   "interface":"fcal API 2.0",
   "source":{
      "href":"https://feiertagskalender.ch",
      "description":"feiertagskalender.ch"
   },
   "copyright":{
      "href":"https://psc.ch",
      "description":"psc Peter Schuetz Informatik-Dienstleistungen, CH Bern"
   },
   "apiName":"CheckDate/CityId",
   "apiStatus":{
      "description":"active"
   },
   "date":"2024-04-16",
   "request":{
      "cityId":"88",
      "date":"2019-04-18",
      "charset":"utf-8",
      "format":"json",
      "date_format":"Y-m-d",
      "hl":"de"
   },
   "results":{
      "status":{
         "description":"ok"
      },
      "location":{
         "description":"Berlin",
         "type":"Stadt",
         "cityId":"88",
         "iso":"DE",
         "iso-3166-2":"DE-BE",
         "date_status":{
            "date":"2019-04-18",
            "total_population":3601131,
            "public_holiday_population":0,
            "public_holiday_percent":0,
            "public_holiday_description":null,
            "school_holiday_population":3601131,
            "school_holiday_percent":100,
            "school_holiday_description":"Osterferien",
            "sum_population":3601131,
            "sum_percent":100
         }
      }
   }
}
					

XML

URL:
https://feiertagskalender.ch/api/CheckDate/CityId/?api_key=YOUR_API_KEY&charset=iso-8859-1&cityId=88&date=2019-04-18&format=xml

Response from the API:

<fcal_api>
	<interface>fcal API 2.0</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>CheckDate/CityId</apiName>
	<date>2024-04-16</date>
	<request>
		<cityId>88</cityId>
		<date>2019-04-18</date>
		<charset>iso-8859-1</charset>
		<format>xml</format>
		<date_format>Y-m-d</date_format>
		<hl>de</hl>
	</request>
	<results>
		<status>
			<description>ok</description>
		</status>
		<location>
			<description>Berlin</description>
			<type>Stadt</type>
			<cityId>88</cityId>
			<iso>DE</iso>
			<iso-3166-2>DE-BE</iso-3166-2>
			<date_status>
				<date>2019-04-18</date>
				<total_population>3601131</total_population>
				<public_holiday_population>0</public_holiday_population>
				<public_holiday_percent>0</public_holiday_percent>
				<public_holiday_description></public_holiday_description>
				<school_holiday_population>3601131</school_holiday_population>
				<school_holiday_percent>100</school_holiday_percent>
				<school_holiday_description>Osterferien</school_holiday_description>
				<sum_population>3601131</sum_population>
				<sum_percent>100</sum_percent>
			</date_status>
		</location>
	</results>
</fcal_api>                  

CSV

URL:
view-source:https://feiertagskalender.ch/api/CheckDate/CityId/?api_key=YOUR_API_KEY&cityId=88&date=2019-04-18&charset=iso-8859-1&format=csv

Response from the API:

"location";"cityId";"iso";"iso-3166-2";"date";"total_population";"public_holiday_population";"public_holiday_percent";"public_holiday_description";"school_holiday_population";"school_holiday_percent";"school_holiday_description";"sum_population";"sum_percent"
"Berlin";"88";"DE";"DE-BE";"2019-04-18";"3601131";"0";"0";"";"3601131";"100";"Osterferien";"3601131";"100"
Pages
Partner projects
©2003 - 2024 psc Peter Schütz Informatik Dienstleistungen, CH-Bern