Enables queries by means of the municipality number of the FSO (Federal Statistical Office) and date. Indicates whether and to what percentage a holiday is valid on this day, or school holidays.
To retrieve the data, use the following URL.
Please pay attention to capital letters.
The following variables can be used to complete the query and affect the API results.
Parameter | Explanation | Examples |
---|---|---|
api_key required |
Your API key |
?api_key=abc-123-def-456 |
BFS required |
Swiss municipality number according to FSO (Swiss Federal Statistical Office) | &BFS=371 |
date | Date of the desired data.
Available according to contract |
&date=2019-04-15 |
class or klasse |
Scope of the holidays by significance. Variants: |
&klasse=5 |
charset | The desired encoding of the answer. Variants: |
&charset=iso-8859-1 |
format | The desired output format. Variants: |
&format=xml |
date_format | The desired date format. Variants: |
&date_format=d.m.Y |
hl | Desired output language. Variants: |
&hl=en |
The contents of the API answers result from:
- the dates you subscribe to (countries, holidays, school holidays, calendar years)
- the official known data of the legislators
- availability based on our research (actual situation of our database)
Please note that the output in CSV format differs
Parameter | Explanation | Example | |||
---|---|---|---|---|---|
interface | Version of the API | ||||
source: | href | URL to data source (website) | |||
description | Name of the data source | ||||
copyright: | href | URL to the copyright owner (website) | |||
description | Designation of the copyright holder | ||||
apiName | Identification of the API | CheckDate/CH/BFS | |||
apiStatus | description | Description of the API status | active | ||
date | Date of data export | 01.05.2025 | |||
request: | bfs | Swiss municipality number, according to request | 371 | ||
date | Date of data in output | 2019-04-15 | |||
charset | Font encoding of the output | utf-8 | |||
format | Data format of the output | json | |||
date_format | Date format, according to request | d.m.Y | |||
hl | Output language | de | |||
results | status | description | Output status | ok | |
location | description | Name of the geographical unit | Biel/Bienne | ||
type | Designation of the type of geographical unit | Gemeinde | |||
geoId | Id of the geographical unit (Id by Feiertagskalender.ch) | 424 | |||
iso | ISO country code, 2 digits | CH | |||
iso-3166-2 | Region code according to ISO 3166-2 | CH-BE | |||
date_status | Day status | ||||
date | Date | 2019-04-15 | |||
total_population | Total number of inhabitants | 54640 | |||
public_holiday_population | No. of inhabitants with holiday | 0 | |||
public_holiday_percent | Percentage of inhabitants with holidays | 0 | |||
public_holiday_description | Designation Holiday | ||||
school_holiday_population | No. of inhabitants with school holidays | 54640 | |||
school_holiday_percent | Percentage of inhabitants with school holidays | 100 | |||
school_holiday_description | Designation School holidays | Frühlingsferien | |||
sum_population | Sum of affected inhabitants | 54640 | |||
percent_population | Percentage of affected inhabitants | 100 |
Place of issue | Error message | Explanation |
---|---|---|
results: status: description | not subscribed | You have not subscribed to the required data. Please contact our support. |
results: status: description | unknown location | The requested FSO number is not known. Please chek the parameter BFS |
apiStatus: description | invalid usage | The use of this API is not intended 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 websites (front-ends) are not permitted. Set up your query so that it comes from a protected back-end. If necessary, please contact the Feiertagskalender.ch support. |
apiStatus: description | inactive | The API has not yet been unlocked for use. Please try again later. |
apiStatus: description | expired | The useful life according to the contract has expired. Please contact the Feiertagskalender.ch Administration for a contract extension. |
Call:
https://feiertagskalender.ch/api/CheckDate/CH/BFS/?api_key=YOUR_API_KEY&bfs=371&date=2019-04-15
Reply in JSON / UTF-8:
{ "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/CH/BFS", "apiStatus":{ "description":"active" }, "date":"2019-04-11", "request":{ "bfs":"371", "date":"2019-04-15", "charset":"utf-8", "format":"json", "date_format":"Y-m-d", "hl":"de" }, "results":{ "status":{ "description":"ok" }, "location":{ "description":"Biel/Bienne", "type":"Gemeinde", "geoId":"424", "iso":"CH", "iso-3166-2":"CH-BE", "date_status":{ "date":"2019-04-15", "total_population":54640, "public_holiday_population":0, "public_holiday_percent":0, "public_holiday_description":null, "school_holiday_population":54640, "school_holiday_percent":100, "school_holiday_description":"Frühlingsferien", "sum_population":54640, "sum_percent":100 } } } }
Call:
https://feiertagskalender.ch/api/CheckDate/CH/BFS/?api_key=YOUR_API_KEY&bfs=371&date=2019-04-15&format=XML
Reply in XML / UTF-8:
<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/CH/BFS</apiName> <date>2019-04-11</date> <request> <bfs>371</bfs> <date>2019-04-15</date> <charset>utf-8</charset> <format>xml</format> <date_format>Y-m-d</date_format> <hl>de</hl> </request> <results> <status> <description>ok</description> </status> <location> <description>Biel/Bienne</description> <type>Gemeinde</type> <geoId>424</geoId> <iso>CH</iso> <iso-3166-2>CH-BE</iso-3166-2> <date_status> <date>2019-04-15</date> <total_population>54640</total_population> <public_holiday_population>0</public_holiday_population> <public_holiday_percent>0</public_holiday_percent> <public_holiday_description/> <school_holiday_population>54640</school_holiday_population> <school_holiday_percent>100</school_holiday_percent> <school_holiday_description>Frühlingsferien</school_holiday_description> <sum_population>54640</sum_population> <sum_percent>100</sum_percent> </date_status> </location> </results> </fcal_api>
Call:
https://feiertagskalender.ch/api/CheckDate/CH/PLZ/?api_key=YOUR_API_KEY&bfs=371&date=2019-04-15&format=csv
Reply in CSV / UTF-8:
"location";"bfs";"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" "Biel/Bienne";"371";"CH";"CH-BE";"2019-04-15";"54640";"0";"0";"";"54640";"100";"Frühlingsferien";"54640";"100"