Existenz.ch Data APIs

These APIs are free for public and non-commercial use, 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 (infrequent) Existenz.ch & Aare.guru API News.

Alternatively get all the news on the Hymnos blog with the tag newsletter (RSS feed).

Integration tipps

Internet of awesome things!

Available APIs

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 up to 32 days in the past. For older data, see the InfluxDB entry below.

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, surface height and more of lakes and rivers in Switzerland.

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, sunshine duration and more.

Note that most stations measure 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

Existenz.ch Custom Sensors Network

Custom sensors installed and maintained by us and friends. Might be experimental, might be down.

Contact me for details if required.

TemperAare Olten

Data provided by the TemperAare App (Android / iOS) by Tobias Oetiker.

Open sensors API documentation Example request Locations Parameters

Long-term data archive in InfluxDB

A long-term 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==
Organization api.existenz.ch
Bucket existenzApi
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 instance as a data source.

Hydrology data archive

The data archive has been augmented with hydrology data from wiewarm.ch and their archive: rc9000/wiewarm-data, starting at 2001. More locations become available in 2003.

Complete BAFU data imports start at 2018.

Sample Flux query
from(bucket: "existenzApi")
  |> range(start: -1y)
  |> filter(fn: (r) => r["_measurement"] == "hydro")
  |> filter(fn: (r) => r["_field"] == "temperature" or r["_field"] == "flow")
  |> filter(fn: (r) => r["loc"] == "2135" or r["loc"] == "2030")
  |> aggregateWindow(every: 1d, fn: max, createEmpty: false)
  |> yield(name: "daily-max")

SwissMetNet data archive

Complete archive since MeteoSwiss started publishing SwissMetNet Open Data in 2013.

Sample Flux query
from(bucket: "existenzApi")
  |> range(start: -1y)
  |> filter(fn: (r) => r["_measurement"] == "smn")
  |> filter(fn: (r) => r["_field"] == "tt")
  |> filter(fn: (r) => r["loc"] == "BER" or r["loc"] == "THU")
  |> aggregateWindow(every: 1d, fn: max, createEmpty: false)
  |> yield(name: "daily-max")

Metadata stored in a Datasette

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

https://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.

MeteoSwiss Blog RSS Feed

Inofficial RSS feed for the MeteoSwiss blog.

See rss.existenz.ch for all language options.

Backend technology

This being a hobbyist project, boring technology is good. It's mostly PHP and SQL. Some InfluxDB is sprinkled in, but turns out to be the most finicky part of the project.

More details (In Swiss german) can be found in the recording of the Aare Guru Techstack Webinar (December 2021).

Open Source

Have some code which was created for this project:

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
rss.existenz.ch An adaptation of RSS-Bridge for the custom MeteoSwiss blog RSS feed.

Security

Please report any security issue according to the security policy.

(Generated on securitytxt.org.)