Skip to content

How to query the infocenter

Concepts

All data in the infocenter is accessible without authorization, but because will add personalization functionalities soon we recommend to add the profile and authorization headers just like you do on the profile api as well.

The infocenter is on e big pool of public data allover Switzerland and so far we did not add any restrictions in accecssing the data by partner. But you must comply to the guidelines described in the chapter data governance and the platform guidlines.

Our goal is to deliver quality data forming a graph expressed by json-ld.

Info

At the moment we provide a REST api only and can not offer a Graph-API like GraphQL - but we really want to add it this year.

Data Models

All our data models are based on the definitions of schema.org.

Definitions

Detailed information about the data models and their relations you can find in the discover.swiss data schema definition.

{
  "continuation": "...",
  "data": [{
    "identifier" : "CH_Zürich_Fischers_Fritz_Campsite_Zurich",
    "@id": "https://api.discover.swiss/dev/info/lodgingbusinesses/CH_Zürich_Fischers_Fritz_Campsite_Zurich",
    "@type": "http://schema.org/LodgingBusiness",
    "additionalType": "https://schema.org/Campground",
    "datasource": "ZHT-CMS",

  },
  ...
  ]
}

Identity

Each Vertex in our graph has its unique identifier which represents excactly 1 object in the real world.

identifier schema.org/identifier which is typically used in the @id property to create the url
@id url to load the details of this object → https://json-ld.org/

Warning

An identifier should only change when the real world object is changing and it should not be some internal discover.swiss id leaking out in the world. Ieally everybody and each system should be able to create it in the same way. Easy examples are cities, the never change their names. After the first experiences we made there will be some changes in the identifiers.

Endpoints

We offer endpoints for all Vertex classes. Properties of values of types of other Vertex classes like "containedInPlace" or "images" contain a simplified model with just enough information to download the full object or in the case of the image display it.

sample endpoints:

  • /places
  • /places/{id}
  • /localbusinesses
  • /localbusinesses/{id}

At the current state a endpoint delivers only objects of exact this type and not derived types. For example a LodgingBusiness or AdministrativeArea is not contained in the list of places. But City is contained in AdministrativeArea endpoint because it has no additional property and technically it is an AdministrativeArea. The type schemaOrg.City is defined in the AdditionalType property.

Tip

Search endpoints which deliver polymorphic results are coming soon.

All list endpoint deliver paged results.

Localization

default: de-CH

Language: Based on the Accept-Language header localized properties are translated.

DateTime formatting: "2019-08-09T13:59:57.097+00:00"

Use Accept-Timezone header to specify request timezone. Supply a TimeZone id property acquired from Infocenter /timezones route in order to get data with desired time offset

Default timezone is W. Europe Standard Time (+02:00)

Number formatting: CH -> 250.00

Next steps


Last update: August 13, 2020 10:07:36