Data sets with the public holidays and school holidays of a year.
Chapters:
To retrieve the data, use the following URL. Please pay attention to upper case lower case.
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 |
BFS required |
Swiss municipality number according to FSO (Federal Statistical Office) | &BFS=371 |
year or jahr |
Year of the requested dates |
&year= 2025 |
class or klasse |
Scope of the data Variants: |
&klasse=5 |
charset | The desired coding of the response 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 language of the output Variants: |
&hl=en |
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 | Data/CH/BFS | ||||
apiStatus | description | Designation of the API status. For variants, see the Error messages | active | |||
date | Date of the data export | 25.04.2024 | ||||
request: | bfs | FSO community number | 371 | |||
year | Year of the data in the output | 2015 | ||||
class | Class of the query (concerns the scope of the data) | 4 | ||||
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 | description | Designation of the geographical unit | Biel/Bienne | |||
type | Designation of the type of geographical unit | Stadt | ||||
geoId | Geo-ID of the geographical unit. | 424 | ||||
iso | ISO country code, 2 digits | CH | ||||
iso-3166-2 | Region code according to ISO 3166-2 | CH-BE | ||||
note | Special notes | NEW 30.03.2023 | ||||
events | The calendar events | |||||
description | Designation of the public holiday, or school holidays | New Year´s Day | ||||
id | Unique ID of the event. Public holidays have the same ID every year. School holidays all have their own IDs. |
1 | ||||
dateStart | Date Start of the event | 01.01.2015 | ||||
dateEnd | Date end of the event | 01.01.2015 | ||||
class | Class of the event: 0 = School holidays 1 = official holiday 2 = Public holiday on a par with Sundays 3 = half-holiday (normally starting from noon) 4 = legally not recognized holiday (shops, schools, administrations mostly closed), bank holiday; for the purposes of the European Convention on the Calculation of Time Limits, this day is treated as a public holiday (Art. 5). 5 = event day # = partially valid |
2 | ||||
percent | Size of affected residents / school classes in percent | 100 | ||||
prov | Flag for provisionally set data 0 = definitely 1 = provisional |
0 | ||||
note | special notes |
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 FSO municipality number is not known. Please check the parameter bfs |
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. |
URL:
https://feiertagskalender.ch/api/Data/CH/BFS/?api_key=YOUR_API_KEY&jahr=2015&date_format=d.m.Y&BFS=371
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": "Data/CH/BFS", "apiStatus": { "description": "active" }, "date": "04.08.2017", "request": { "bfs": "371", "year": "2015", "class": "4", "charset": "utf-8", "format": "json", "hl": "de" }, "results": { "status": { "description": "ok" }, { "location": { "description": "Biel/Bienne", "type": "Gemeinde", "geoId": "424", "iso": "CH", "iso-3166-2": "CH-BE", "events": [{ "description": "Neujahrstag", "id": "1", "dateStart": "01.01.2015", "dateEnd": "01.01.2015", "class": "2", "percent": "100", "prov": "0", "note": null }, { "description": "Berchtoldstag", "id": "3", "dateStart": "02.01.2015", "dateEnd": "02.01.2015", "class": "2", "percent": "100", "prov": "0", "note": null }, { "description": "Karfreitag", "id": "17", "dateStart": "03.04.2015", "dateEnd": "03.04.2015", "class": "2", "percent": "100", "prov": "0", "note": null }, { "description": "Ostern", "id": "18", "dateStart": "05.04.2015", "dateEnd": "05.04.2015", "class": "4", "percent": "100", "prov": "0", "note": null }, { "description": "Ostermontag", "id": "19", "dateStart": "06.04.2015", "dateEnd": "06.04.2015", "class": "2", "percent": "100", "prov": "0", "note": null }, { "description": "Auffahrt", "id": "31", "dateStart": "14.05.2015", "dateEnd": "14.05.2015", "class": "2", "percent": "100", "prov": "0", "note": null }, { "description": "Pfingsten", "id": "30", "dateStart": "24.05.2015", "dateEnd": "24.05.2015", "class": "4", "percent": "100", "prov": "0", "note": null }, { "description": "Pfingstmontag", "id": "35", "dateStart": "25.05.2015", "dateEnd": "25.05.2015", "class": "2", "percent": "100", "prov": "0", "note": null }, { "description": "Nationalfeiertag Schweiz", "id": "12", "dateStart": "01.08.2015", "dateEnd": "01.08.2015", "class": "2", "percent": "100", "prov": "0", "note": null }, { "description": "Weihnachten", "id": "23", "dateStart": "25.12.2015", "dateEnd": "25.12.2015", "class": "2", "percent": "100", "prov": "0", "note": null }, { "description": "Stephanstag", "id": "37", "dateStart": "26.12.2015", "dateEnd": "26.12.2015", "class": "2", "percent": "100", "prov": "0", "note": null }, { "description": "Winterferien", "id": "214542", "dateStart": "20.12.2014", "dateEnd": "4.01.2015", "class": "0", "percent": "100", "prov": "0", "note": null }, { "description": "Sportferien", "id": "271745", "dateStart": "7.02.2015", "dateEnd": "15.02.2015", "class": "0", "percent": "100", "prov": "0", "note": null }, { "description": "Fr\u00fchlingsferien", "id": "214543", "dateStart": "3.04.2015", "dateEnd": "19.04.2015", "class": "0", "percent": "100", "prov": "0", "note": null }, { "description": "Tag der Arbeit", "id": "294008", "dateStart": "1.05.2015", "dateEnd": "1.05.2015", "class": "0", "percent": "100", "prov": "0", "note": null }, { "description": "Auffahrtsferien", "id": "277391", "dateStart": "14.05.2015", "dateEnd": "17.05.2015", "class": "0", "percent": "100", "prov": "0", "note": null }, { "description": "Pfingstferien", "id": "277392", "dateStart": "25.05.2015", "dateEnd": "25.05.2015", "class": "0", "percent": "100", "prov": "0", "note": null }, { "description": "Sommerferien", "id": "271746", "dateStart": "4.07.2015", "dateEnd": "16.08.2015", "class": "0", "percent": "100", "prov": "0", "note": null }, { "description": "Herbstferien", "id": "294005", "dateStart": "3.10.2015", "dateEnd": "18.10.2015", "class": "0", "percent": "100", "prov": "0", "note": null }, { "description": "Winterferien", "id": "214546", "dateStart": "19.12.2015", "dateEnd": "3.01.2016", "class": "0", "percent": "100", "prov": "0", "note": null }] } } }
URL:
https://feiertagskalender.ch/api/Data/CH/BFS/?api_key=YOUR_API_KEY&charset=iso-8859-1&date_format=d.m.Y&BFS=371&jahr=2015&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>Data/CH/BFS</apiName> <date>04.08.2017</date> <request> <bfs>371</bfs> <year>2015</year> <class>4</class> <charset>utf-8</charset> <format>xml</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> <events> <event> <description>Neujahrstag</description> <id>1</id> <dateStart>01.01.2015</dateStart> <dateEnd>01.01.2015</dateEnd> <class>2</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Berchtoldstag</description> <id>3</id> <dateStart>02.01.2015</dateStart> <dateEnd>02.01.2015</dateEnd> <class>2</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Karfreitag</description> <id>17</id> <dateStart>03.04.2015</dateStart> <dateEnd>03.04.2015</dateEnd> <class>2</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Ostern</description> <id>18</id> <dateStart>05.04.2015</dateStart> <dateEnd>05.04.2015</dateEnd> <class>4</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Ostermontag</description> <id>19</id> <dateStart>06.04.2015</dateStart> <dateEnd>06.04.2015</dateEnd> <class>2</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Auffahrt</description> <id>31</id> <dateStart>14.05.2015</dateStart> <dateEnd>14.05.2015</dateEnd> <class>2</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Pfingsten</description> <id>30</id> <dateStart>24.05.2015</dateStart> <dateEnd>24.05.2015</dateEnd> <class>4</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Pfingstmontag</description> <id>35</id> <dateStart>25.05.2015</dateStart> <dateEnd>25.05.2015</dateEnd> <class>2</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Nationalfeiertag Schweiz</description> <id>12</id> <dateStart>01.08.2015</dateStart> <dateEnd>01.08.2015</dateEnd> <class>2</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Weihnachten</description> <id>23</id> <dateStart>25.12.2015</dateStart> <dateEnd>25.12.2015</dateEnd> <class>2</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Stephanstag</description> <id>37</id> <dateStart>26.12.2015</dateStart> <dateEnd>26.12.2015</dateEnd> <class>2</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Winterferien</description> <id>214542</id> <dateStart>20.12.2014</dateStart> <dateEnd>4.01.2015</dateEnd> <class>0</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Sportferien</description> <id>271745</id> <dateStart>7.02.2015</dateStart> <dateEnd>15.02.2015</dateEnd> <class>0</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Frühlingsferien</description> <id>214543</id> <dateStart>3.04.2015</dateStart> <dateEnd>19.04.2015</dateEnd> <class>0</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Tag der Arbeit</description> <id>294008</id> <dateStart>1.05.2015</dateStart> <dateEnd>1.05.2015</dateEnd> <class>0</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Auffahrtsferien</description> <id>277391</id> <dateStart>14.05.2015</dateStart> <dateEnd>17.05.2015</dateEnd> <class>0</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Pfingstferien</description> <id>277392</id> <dateStart>25.05.2015</dateStart> <dateEnd>25.05.2015</dateEnd> <class>0</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Sommerferien</description> <id>271746</id> <dateStart>4.07.2015</dateStart> <dateEnd>16.08.2015</dateEnd> <class>0</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Herbstferien</description> <id>294005</id> <dateStart>3.10.2015</dateStart> <dateEnd>18.10.2015</dateEnd> <class>0</class> <percent>100</percent> <prov>0</prov> <note></note> </event> <event> <description>Winterferien</description> <id>214546</id> <dateStart>19.12.2015</dateStart> <dateEnd>3.01.2016</dateEnd> <class>0</class> <percent>100</percent> <prov>0</prov> <note></note> </event> </events> </location> </results> </fcal_api>
URL:
https://feiertagskalender.ch/api/Data/CH/BFS/?api_key=YOUR_API_KEY&charset=iso-8859-1&date_format=d.m.Y&BFS=371&jahr=2015&format=csv
Response from the API:
"location";"bfs";"description";"id";"dateStart";"dateEnd";"class";"percent";"prov";"note" "Biel/Bienne";"371";"Neujahrstag";"1";"01.01.2015";"01.01.2015";"2";"100";"0";"" "Biel/Bienne";"371";"Berchtoldstag";"3";"02.01.2015";"02.01.2015";"2";"100";"0";"" "Biel/Bienne";"371";"Karfreitag";"17";"03.04.2015";"03.04.2015";"2";"100";"0";"" "Biel/Bienne";"371";"Ostern";"18";"05.04.2015";"05.04.2015";"4";"100";"0";"" "Biel/Bienne";"371";"Ostermontag";"19";"06.04.2015";"06.04.2015";"2";"100";"0";"" "Biel/Bienne";"371";"Auffahrt";"31";"14.05.2015";"14.05.2015";"2";"100";"0";"" "Biel/Bienne";"371";"Pfingsten";"30";"24.05.2015";"24.05.2015";"4";"100";"0";"" "Biel/Bienne";"371";"Pfingstmontag";"35";"25.05.2015";"25.05.2015";"2";"100";"0";"" "Biel/Bienne";"371";"Nationalfeiertag Schweiz";"12";"01.08.2015";"01.08.2015";"2";"100";"0";"" "Biel/Bienne";"371";"Weihnachten";"23";"25.12.2015";"25.12.2015";"2";"100";"0";"" "Biel/Bienne";"371";"Stephanstag";"37";"26.12.2015";"26.12.2015";"2";"100";"0";"" "Biel/Bienne";"371";"Winterferien";"214542";"20.12.2014";"4.01.2015";"0";"100";"0";"" "Biel/Bienne";"371";"Sportferien";"271745";"7.02.2015";"15.02.2015";"0";"100";"0";"" "Biel/Bienne";"371";"Frühlingsferien";"214543";"3.04.2015";"19.04.2015";"0";"100";"0";"" "Biel/Bienne";"371";"Tag der Arbeit";"294008";"1.05.2015";"1.05.2015";"0";"100";"0";"" "Biel/Bienne";"371";"Auffahrtsferien";"277391";"14.05.2015";"17.05.2015";"0";"100";"0";"" "Biel/Bienne";"371";"Pfingstferien";"277392";"25.05.2015";"25.05.2015";"0";"100";"0";"" "Biel/Bienne";"371";"Sommerferien";"271746";"4.07.2015";"16.08.2015";"0";"100";"0";"" "Biel/Bienne";"371";"Herbstferien";"294005";"3.10.2015";"18.10.2015";"0";"100";"0";"" "Biel/Bienne";"371";"Winterferien";"214546";"19.12.2015";"3.01.2016";"0";"100";"0";""