Making a Weather Skin

Now that you have an API Key, we can use this to start querying data and making skins

DISCLAIMER: This guide is going to assume you've read the Rainmeter Manual already and have a decent understanding of how skins work. READ THE MANUAL.

Using the API

Now that you have an API key and the ID for your city of choice, you can get started on a skin. First we need to setup our variables

[Variables]
APIKey=(your API key)
CityID=(your city ID)
Units=(imperial/metric)
  • Plugin in the values you got from the OpenWeather website, and feel free to change the variable names

  • Units needs to be either imperial or metric . For Fahrenheit choose imperial, and for Celsius choose metric

Next we need to use a WebParser Measure to call the API:

[MeasureSite]
Measure=WebParser
URL=https://api.openweathermap.org/data/2.5/weather?id=#CityID#&appid=#APIKey#&units=#Units#
RegExp=(?siU)"main":"(.*)".*"temp":(.*),.*"feels_like":(.*),.*"temp_min":(.*),.*"temp_max":(.*),.*"humidity":(.*)}.*"wind":{"speed":(.*),.*"clouds":{"all":(.*)}.*"name":"(.*)".*
UpdateRate=3600
  • This measure uses the methods detailed here to call the OpenWeather API by a City ID:api.openweathermap.org/data/2.5/weather?id={city id}&appid={your api key}

  • We then use a regular expression to take out the most pertinent values such as the temperature, windspeed, etc. There are many more parameters that can be accessed which are detailed here. Simply change the RegExp to parse different values.

Here's a full example skin (Loading this will do nothing):

For more help with syntax and making things your own checkout the manual:

When distributing your skin, you should not include the city code or API key used in development. Keep your values private, and instead direct end users to get their own.

Last updated