API documentation

API function control

Check the status of your API key

Data set with the status of your API key.

API: api_key

Chapters:

API: api_key

Function

Displays the status of your API key.

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
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

Return values of the API

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 api_key
date         Date of the data export 08.08.2022
apiKeyStatus         Output status. For variants, see the Error messages active
apiDateStart         Date of activation of API access 01.01.2015
apiDateEnd         API access contract end date 31.12.2018
apiData            
  dataPublicHolidays       Scope of subscribed countries for public holidays

Options
- all
- ISO country code, 2 digits, comma separated
AT,CH,DE
  yearsPublicHolidays       Scope of subscribed years for public holidays 2015,2016,2017,2018
  dataSchoolHolidays      

Scope of subscribed countries for school holidays

Options
- all
- ISO country code, 2 digits, comma separated

CH
  yearsSchoolHolidays       Scope of subscribed years for school holidays 2015,2016,2017,2018
apiList api       List of all APIs enabled for you  

Error messages

Output location Error message Explanation
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/api_key/?api_key=YOUR_API_KEY

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": "api_key",
	"date":"2022-08-08",
	"apiKeyStatus": "active",
	"apiDateStart": "2014-06-01",
	"apiDateEnd": "2023-06-01",
	"apiData": {
		"dataPublicHolidays": "AT,CH,DE",
		"yearsPublicHolidays": "2015,2016,2017,2018,2019,2020",
		"dataSchoolHolidays": "AT,CH,DE",
		"yearsSchoolHolidays": "2015,2016,2017,2018,2019,2020"
	},
	"apiList": [{
		"api": "api_key"
	}, {
		"api": "Data/CH/BFS"
	}, {
		"api": "Data/CH/Kanton"
	}, {
		"api": "Data/CH/PLZ"
	}, {
		"api": "Data/CityId"
	}, {
		"api": "Data/GeoId"
	}, {
		"api": "GeoTree/ISO"
	}]
}

XML

URL:
https://feiertagskalender.ch/api/api_key/?api_key=YOUR_API_KEY&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>
	<date>2022-08-08</date>
	<apiName>api_key</apiName>
	<apiKeyStatus>active</apiKeyStatus>
	<apiDateStart>2014-06-01</apiDateStart>
	<apiDateEnd>2022-06-01</apiDateEnd>
	<apiData>
		<dataPublicHolidays>AT,CH,DE</dataPublicHolidays>
		<yearsPublicHolidays>2015,2016,2017,2018,2019,2020</yearsPublicHolidays>
		<dataSchoolHolidays>AT,CH,DE</dataSchoolHolidays>
		<yearsSchoolHolidays>2015,2016,2017,2018,2019,2020</yearsSchoolHolidays>
	</apiData>
	<apiList>
		<api>api_key</api>
		<api>Data/CH/BFS</api>
		<api>Data/CH/Kanton</api>
		<api>Data/CH/PLZ</api>
		<api>Data/CityId</api>
		<api>Data/GeoId</api>
		<api>GeoTree/ISO</api>
	</apiList>
</fcal_api>                  

CSV

Aufruf:
https://feiertagskalender.ch/api/api_key/?api_key=YOUR_API_KEY&format=csv

Response from the API:

"interface";"apiKeyStatus";"apiDateStart";"apiDateEnd";"dataPublicHolidays";"yearsPublicHolidays";"dataSchoolHolidays";"yearsSchoolHolidays";"api"
"fcal API 2.0";"active";"2014-06-01";"2020-05-31";"AT,CH,DE";"2015,2016,2017,2018,2019,2020";"AT,CH,DE";"2015,2016,2017,2018,2019,2020";"api_key"
"fcal API 2.0";"active";"2014-06-01";"2020-05-31";"AT,CH,DE";"2015,2016,2017,2018,2019,2020";"AT,CH,DE";"2015,2016,2017,2018,2019,2020";"Data/CH/BFS"
"fcal API 2.0";"active";"2014-06-01";"2020-05-31";"AT,CH,DE";"2015,2016,2017,2018,2019,2020";"AT,CH,DE";"2015,2016,2017,2018,2019,2020";"Data/CH/Kanton"
"fcal API 2.0";"active";"2014-06-01";"2020-05-31";"AT,CH,DE";"2015,2016,2017,2018,2019,2020";"AT,CH,DE";"2015,2016,2017,2018,2019,2020";"Data/CH/PLZ"
"fcal API 2.0";"active";"2014-06-01";"2020-05-31";"AT,CH,DE";"2015,2016,2017,2018,2019,2020";"AT,CH,DE";"2015,2016,2017,2018,2019,2020";"Data/CityId"
"fcal API 2.0";"active";"2014-06-01";"2020-05-31";"AT,CH,DE";"2015,2016,2017,2018,2019,2020";"AT,CH,DE";"2015,2016,2017,2018,2019,2020";"Data/GeoId"
"fcal API 2.0";"active";"2014-06-01";"2020-05-31";"AT,CH,DE";"2015,2016,2017,2018,2019,2020";"AT,CH,DE";"2015,2016,2017,2018,2019,2020";"GeoTree/ISO"
©2003 - 2022 psc Peter Schütz Informatik Dienstleistungen, CH-Arch