# Create a weather widget using Weatherstack and Google Sheets

Learn how to build a widget displaying weather data using Weatherstack data.

May 13, 2025

To create a weather widget using Google Sheets, follow these steps:

01. To begin, **create a free [Weatherstack account](https://weatherstack.com/signup/free).**  
02. [Locate your API Access Key](https://weatherstack.com/dashboard?logged_in=1), you'll need this shortly.
03. Make a copy of this [Google Sheet template](https://docs.google.com/spreadsheets/d/1DwjO7lQaU7qadJExLRD9V6bnEva0Hra8IzjkU9cSFUQ/copy).
04. In cell `A2`, enter your city as "`City, CO`" where `City` is the name of your city, and `CO` is a [two-letter code identifier of your state](https://www.ssa.gov/international/coc-docs/states.html) if in the US, or a [two-letter code identifier of your country](https://www.iban.com/country-codes) if outside of the US.

1. For a US city, you could enter `New York, NY`. For a city outside the US, you could enter `London, UK`.

05. In cell `A5`, paste the **API Access Key** for Weatherstack that you retrieved earlier.
06. In cell `A9`, enter `m` to get the temperature in Celsius or `f` to get the temperature in Fahrenheit.
07. Click on the **Tools** menu and select the option **Script editor.**
08. Click on the Trigger menu.

09. Click the **\+ Add Trigger** button in the bottom right corner of the page.

10. Set a trigger for the **myFunction** function, which runs from **Head** on a **Time-driven** source triggered by an **Hourly timer** like so:

11. Return to the script, select the function and then click Run.

Running the script will retrieve (on cells `D2` and `D3`) the weather for the city you entered on cell `A2` on an hourly basis. You can use that weather data and our [Spreadsheets data source](https://support.geckoboard.com/hc/en-us/articles/214954487) to build a text widget using the concatenated cell `D4` for your dashboard, which will update hourly. Now you'll know if you need the umbrella when you're heading out.
