Open Weather Maps API Key

We'll be using OpenWeatherMaps.org to retrieve the weather info through its API. In order to do so, you'll need to register for an account and get your API key.

Go to this link and register for a free account. Once registered, you'll get an email containing your API key, also known as the "openweather token".

Copy and paste this key into your secrets.py file that is on the root level of your CIRCUITPY drive, so it looks something like this:

# SPDX-FileCopyrightText: 2020 Limor Fried for Adafruit Industries
#
# SPDX-License-Identifier: MIT

# This file is where you keep secret settings, passwords, and tokens!
# If you put them in the code you risk committing that info or sharing it

secrets = {
    'ssid' : 'my_ssid',
    'password' : 'my_pass',
    'timezone' : "America/New_York", # http://worldtimeapi.org/timezones
    'openweather_token' : 'putYourOpenWeatherTokenHere',
    }

This guide was first published on Apr 08, 2020. It was last updated on Feb 27, 2020.

This page (OpenWeather API setup) was last updated on May 31, 2023.

Text editor powered by tinymce.