> For the complete documentation index, see [llms.txt](https://lfgberg.gitbook.io/rainmeter/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lfgberg.gitbook.io/rainmeter/making-a-weather-skin.md).

# 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](https://docs.rainmeter.net/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](https://openweathermap.org/current) to call the OpenWeather API by a City ID:`api.openweathermap.org/data/2.5/weather?id={city id}&appid={your api key}`&#x20;
* 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](https://openweathermap.org/current#current_JSON). Simply change the RegExp to parse different values.

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

{% file src="/files/-M8JGogPbw1H9\_-lFLBs" %}
OpenWeather Example
{% endfile %}

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

* [Help with WebParser](https://docs.rainmeter.net/tips/webparser-tutorial/)
* [Help with RegExp](https://docs.rainmeter.net/manual/skins/option-types/#RegExp)

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.
