Skip to main content

Create a weather widget using Weatherstack and Google Sheets

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

Updated yesterday

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

  1. To begin, create a free Weatherstack account.

  2. Locate your API Access Key, you'll need this shortly.

  3. Make a copy of this Google Sheet template.

  4. 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 if in the US, or a two-letter code identifier of your country 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.

  5. In cell A5, paste the API Access Key for Weatherstack that you retrieved earlier.

  6. In cell A9, enter m to get the temperature in Celsius or f to get the temperature in Fahrenheit.

  7. Click on the Tools menu and select the option Script editor.

  8. Click on the Trigger menu.

    Add a trigger to your Apps script
  9. Click the + Add Trigger button in the bottom right corner of the page.

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

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

    Run the function

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 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.

Weather widget
Did this answer your question?