meteoblue API documentation
The API is designed to provide easy access via HTTP-URLs to all types of weather data. Various weather variables are grouped into packages.
Lets assume we want to request the 7 day weather forecast with hourly data for Basel, Switzerland. Basel is located at 47.57° North / 7.6° East and 263m above mean sea level. The URL would look like the following:
To break it down:
- http://my.meteoblue.com/packages/basic-1h?: This identifies the address and our basic data package.
- http://my.meteoblue.com/visimage/meteogram_14day?: This shows the address for images like our meteogaram 14day.
- &lat=47.57&lon=7.6&asl=263: Coordinates and altitude for Basel
- &apikey=PersonalAPIKey: This is your personal API key
- &name=Basel: City name shown on images
- &tz=Europe%2Zurich: Time zone of selected place
- &lang=en: Select language for images (iso2 code)
- &temperature=C: Select temperature unit
- &windspeed=ms-1: Select wind speed unit
- &winddirection=degree: Select wind direction unit
- &precipitationamount=mm: Select precipitation amount unit
- &timeformat=Y-M-D: Select time format
- &format=json: Select output format
More information about the API URL parameters.
If you open this URL in a web browser it will produce an output as follows. Please note, that this API key is not valid.
This approach makes it easy and cost-efficient to integrate our API into automated systems or web applications. All data can be accessed on demand and processed further.
Advanced security options
As you may have noticed your API request is only authorised by your API key. To prevent unauthorized access and "reply attacs" we offer a signature mechanism with a shared secret. On request we will associate a shared secret with your api key and enforce the signature security policy. To sign a request you have to add an unix timestamp to your url and calculate a MD5 hash of the whole request string and the assigned shared secret. The request will expire after 5 minutes. In PHP the mechanism is trivial:
For mobile applications we recommend a proxy for authorisation and cache.
|secret||Private key used to calculate the signature. Provided by meteoblue on request||String||-|
|ts||Current unix timestamp||unix timestamp, Integer||-|
Technical documentation of the meteoblue API: