Existenz.ch Data APIs

These APIs are free for public and non-commercial usage, lovingly handcrafted by Christian Studer (Bureau für digitale Existenz). These APIs are unofficial. There is no guarantee of availability or top performance. They are actively monitored though.

Additional licencing restrictions may apply by the original data owner (For example MeteoSwiss or the BAFU).

Please don't abuse the APIs offered here. You are welcome to drop me a mail to cstuder@existenz.ch if you find them useful or need help.

For statistical purposes add &app={your app name} and optionally add &version={your app version} to all of your requests.

Do you like data to be easily accessible? Consider joining Opendata.ch, the Swiss section of the Open Knowledge Foundation.

Status

See status.existenz.ch for basic status information.

Newsletter

Subscribe to the Existenz.ch Data APIs Newsletter here: (Low frequency of mailings)

powered by TinyLetter

Integration tipps

Internet of awesome things!

Available APIs

Time series APIs BAFU Hydrology API
SwissMetNet Weather Measurement API
InfluxDB 2 access to the time series
Metadata stored in a Datasette
Specialised APIs Aare.guru API
Legacy Aare API (Outdated, but still active)

Time series APIs

Time series share a common API, consisting of four methods for accessing locations, parameters, the latest values and date ranges for historical values.

BAFU Hydrology API

BAFU/FOEN (Bundesamt für Umwelt/Federal Office for the Environment) hydrology data from hydrodaten.admin.ch.

Measures water temperature, water flow and the surface height of rivers in Switzerland. No lakes though.

BAFU data needs to be credited and linked to the BAFU.

Periodicity: 10 minutes.

Open hydro API documentation Example request Locations Parameters

SwissMetNet Weather Measurement API

MeteoSwiss (Bundesamt für Meteorologie und Klimatologie/Federal Office of Meteorology and Climatology) offers a selection of their SwissMetNet data on the opendata.swiss portal.

Measures air temperatures, rain rate, winds, pressure, geopotentials and sunshine duration.

Note that most stations measure this 2 meters above ground, but some tower stations locate their sensors higher in the air. The parameters with suffix _tow are measured on tower stations.

Periodicity: 10 minutes.

Open smn API documentation Example request Locations Parameters

InfluxDB 2 access to the time series

An experimental archive of Hydrology and SwissMetNet data is available as an InfluxDB 2 data source. Use the following readonly token to access the data:

URL https://influx.konzept.space
Token 0yLbh-D7RMe1sX1iIudFel8CcqCI8sVfuRTaliUp56MgE6kub8-nSd05_EJ4zTTKt0lUzw8zcO73zL9QhC3jtA==
Bucket existenzApi
Organization api.existenz.ch
Precision s (Seconds)

There is currently no public visualization available (Mainly due to the lack of a readonly user for the InfluxDB GUI.) But you can use tools such as Grafana to connect this InfluxDB as a data source.

Metadata stored in a Datasette

The timeseries metadata (locations and parameters) including a map are additionally stored in a Datasette at the following location:

api-datasette.konzept.space

The Datasette offers its own metadata API, CSV export and convenient links to the Existenz.ch API.

Specialised APIs

Both old and new.

Aare.guru API

Please refer to aareguru.existenz.ch for the APIs used by the urban swimming website and app Aare.guru.

Legacy Aare API (Outdated, but still active)

An old version of the BAFU Hydrology API is running on aare.schwumm.ch/api.

Please use the new BAFU Hydrology API instead.

Backend technology

This being a hobbyist project, boring technology is good. It's mostly PHP and SQL.

Open Source

Have some code which was created for this project:

Repository
parse-swissmetnet PHP package to parse SwissMetNet Open Data strings
parse-hydrodaten PHP package to parse Hydrodaten (FOEN/BAFU) Open Data strings
temporal-shelf PHP package to shelve files in directory structures according to years/months/days
api-datasette Python generator for the Datasette containing data related to api.existenz.ch

Security

Please report any security issue according to the security policy.

(Generated on securitytxt.org.)