Skip to main content

SRF Meteo weather forecast in Switzerland

Project description

Swiss Weather API

This is a library to consume the SRF Meteo weather API published by Switzerland's public broadcasting cooperation, SRG SSR. You can find the API documentation on their website.

Usage

First, you must apply for a developer token and agree to their terms. As of this writing (June 2020), this is free for non-commercial use. After being accepted, you will get a client_id and client_secret you can use to interact with the service using this Python library.

All endpoints require the following parameters to be passed along:

client_id: the username you received from registering as developer from the link above

client_password: the matching password you received from registering as developer from the link above

latitude: the first part of the coordinates from the location in Switzerland you want to know the forecast in WGS 84 notation.

longitude: the second part of the coordinates from the location in Switzerland you want to know the forecast in WGS 84 notation.

You can use an online map service like https://map.geo.admin.ch to get the coordinates for location you are interested in. Make sure you get the coordinates in the WGS 84 notation, not in the Swiss coordinate system. For this, you can switch to the WGS 84 notation in the dropdown at the bottom left of the map screen. Then move the mouse over the location you are interested in and you will see the coordinates next to the dropdown at the bottom of the map.

Currently, the following end-points are supported:

Daily forecast for location

https://api.srgssr.ch/forecasts/v1.0/weather/current: Returns current weather forecast for all Swiss locations.

You get this forecast by calling getCurrentForecast(client_id: str, client_secret: str, latitude: str, longitude: str).

To find out about the information provided in the payload, have a look at the official documentation for currentforecast.

Seven day forecast for location

https://api.srgssr.ch/forecasts/v1.0/weather/7day: Returns next 7 days forecast for specific location.

You get this forecast by calling getSevenDayForecast(client_id: str, client_secret: str, latitude: str, longitude: str).

To find out about the information provided in the payload, have a look at the official documentation for weeksforecastbyid.

Hourly Forecast for location

https://api.srgssr.ch/forecasts/v1.0/weather/nexthour: Returns forecast data for the next hour for a specific location.

You get this forecast by calling getHourlyForecast(client_id: str, client_secret: str, latitude: str, longitude: str).

To find out about the information provided in the payload, have a look at the official documentation for hourforecastbyid.

24 hour forecast for location

https://api.srgssr.ch/forecasts/v1.0/weather/24hour: Returns cities within Swiss locations.

You get this forecast by calling get24HourForecast(client_id: str, client_secret: str, latitude: str, longitude: str).

To find out about the information provided in the payload, have a look at the official documentation for 24hourforecastbyid.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swissweather-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swissweather-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file swissweather-0.1.0.tar.gz.

File metadata

  • Download URL: swissweather-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for swissweather-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2396b8a0755db35b2efa21358b73f90a2b9f7a60748e7b04c92a40e133b6c24b
MD5 ab6ff9aaef2acb32c916fdd179262e29
BLAKE2b-256 de3aa7c0268348d68de030cfd8a302d11529db3f06dc660ff54156a582480144

See more details on using hashes here.

File details

Details for the file swissweather-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: swissweather-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for swissweather-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 84ad2ac4e9e3c36bbe00639941b94d37d3f1464b4fc4a376b18bc7bd89138f1b
MD5 88d3b0ebdd655ba1e59fe81b0129cdcb
BLAKE2b-256 eb133611a784a51103d2da5f102e3ec7da92ecf1d16025887ef6b71d626e8518

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page