How to use API key

Add the following parameter to the GET request: APPID=APIKEY Example: api.openweathermap.org/data/2.5/forecast/city?APPID=YOURAPIKEY & what ever you want to request.

<?php

    $request = 'http://api.openweathermap.org/data/2.5/forecast/city?APPID=***YOURAPIKEY***';
    $response  = file_get_contents($request);
    $jsonobj  = json_decode($response);
    print_r($jsonobj);
?>

To request specific information just look at the keys that the API accepts and append & to the end of the url KEY=VAL.

An example would be

http://api.openweathermap.org/data/2.5/weather?APPID=YourAPIKey&q=London

I would also like to add when working with API's I recommend installing a JSON viewer plugin. I got the JSONView installed as a Google chrome extension which is brilliant for viewing json.

https://chrome.google.com/webstore/search/jsonview?hl=en

Answer from Mark on Stack Overflow
🌐
OpenWeatherMap
openweathermap.org › appid
How to start to work with Openweather API
Once you sign up using your email, the API key (APPID) will be sent to you in a confirmation email. Your API keys can always be found on your account page, where you can also generate additional API keys if needed.
APIs
This key is required for all API requests. ... OpenWeather offers a variety of APIs to fit different needs. Get full technical documentation, response examples, and integration tips.
Guide
Explore OpenWeather's user-friendly weather data products and APIs, offering short and long-term forecasts, historical observations, and specialized solutions like Road Risk and Solar Energy Prediction. Ideal for range of applications, from simple ones to complex enterise level systems.
Maps
Interactive global weather map with temperature, precipitation, wind, clouds, and pressure layers
Initiatives
Discover OpenWeather's initiatives supporting Education, Healthcare research, Open Source development, and global weather station contributions. Join our vibrant community of weather enthusiasts in advancing meteorological data for critical global challenges.
🌐
OpenWeatherMap
openweathermap.org › api
Weather API
You can cap how many locations with the same name or the nearby geographic coordinates will be seen in the API response ... Create an account on OpenWeather to access your dashboard and generate your unique API key.
Discussions

php - How to use openweathermap api key? - Stack Overflow
I have openweathermap api key , but how can I use it in PHP ? and the weather report should be report from a city name, not from the location weather ID More on stackoverflow.com
🌐 stackoverflow.com
how do i use a weather key API? i don't really understand how to put it in or how to work weather key itself
The developer notes say you need an open weather api key. https://openweathermap.org/api More on reddit.com
🌐 r/Ubersicht
5
2
January 22, 2023
python - How to use openweathermap API Key - Stack Overflow
I'm trying to use Openweathermap for Python with PyOWM, and I have my API key but I've got no idea how to use it in my python program. I've got no idea what the Use OpenWeatherMap API page is tryi... More on stackoverflow.com
🌐 stackoverflow.com
How to set Open Weather Map API Key
make sure underneath the PIN, it's "Yes", which means the watch has connection to your phone. More on reddit.com
🌐 r/watchfacebuilder
72
15
February 19, 2022
🌐
OpenWeatherMap
openweathermap.org › faq
Frequently Asked Questions
How to do it: Sign up and get an API key (APPID) on your account page.
🌐
Samsung Developer
developer.samsung.com › galaxy-watch-tizen › studio › tutorial › get-weather-api-key.html
Get a Weather API Key | Samsung Developer
You must read and comply with OpenWeather’s terms of service. Once you get confirmation that your account is active, log in. After you log in to your OpenWeather account, click the API keys tab and copy your API key.
🌐
GitHub
gist.github.com › lalithabacies › c8f973dc6754384d6cade282b64a8cb1
Open weather API key · GitHub
this code can be written in a simple notepad and saved in an html file, replacing the icon with any .ico if something doesn't work, you can create your own icon from any photo on the internet directly from .png to .ico Thank you all for your attention)) There is also an option to replace the weather city with your own instead of "London" and specify your API-Key. ... Можу підтвердити, що 27 квітня ключ все ще працює. URL-адреса: https://api.openweathermap.org/data/2.5/weather?q=London&appid=bd5e378503939ddaee76f12ad7a97608&units=metric
🌐
OpenWeather
docs.openweather.co.uk › appid
How to start to work with Openweather API - OpenWeather
Click on Sign up and fill out a short form and get an API key (APPID) on your account page.
Find elsewhere
🌐
IONOS
ionos.com › digital guide › websites › web development › openweather api key
How to generate an OpenWeather API key - IONOS
May 6, 2024 - Step 3: Fill out the invoice form and complete sign up. Make sure to link your plan to your API key for API calls. Step 4: Find your server IP for the paid API plan in your con­fir­ma­tion email. If you want to create new API keys or see an overview of already created keys, follow these steps:
🌐
Educative
educative.io › answers › how-to-get-the-openweather-api-key
How to get the OpenWeather API key
Click the "Run" button to test whether the API key is valid. ... print('Your account is temporary blocked due to exceeding of requests limitation of your subscription type. Please choose the proper subscription http://openweathermap.org/price')
🌐
Stanford
web.stanford.edu › group › csp › cs22 › using-an-api.pdf pdf
Using an API (with OpenWeatherMap.org as an example)
For this tutorial, we will be using OpenWeatherMap.org’s API to display current weather information. 1. Visit http://openweathermap.org/appid and click Sign Up. 2. Create a new account by entering the desired information, and then click Create Account. 3. Click API Keys to view your existing ...
🌐
OpenWeatherMap
openweathermap.org › guide
OpenWeatherMap API guide
Detailed API documentation and integration guidance are available for all products. ... Data updates are released every 10 minutes to ensure timely delivery.
🌐
Locationweather
locationweather.io › docs › get-openweathermap-api-key
Get Your Weather API Key – Location Weather Docs
November 13, 2023 - Once logged in, go to My API keys or visit home.openweathermap.org/api_keys.
🌐
Thingpulse
docs.thingpulse.com › how-tos › openweathermap-key
Create OpenWeatherMap API key -
It uniquely ties requests from ... in the "Free" column. By using the free plan you are limited to 60 calls per minute. In the "Free" column click on "Get API key and Start"....
🌐
OpenWeatherMap
openweathermap.org › current
Current weather data
You can use the lang parameter to get the output in your language. Translation is applied for the city name and description fields. https://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&appid={API key}&lang={lang} { "coord": { "lon": 37.62, "lat": 55.75 }, "weather": [ { "id": 501, "main": "Rain", "description": "pluie modérée", "icon": "10d" } ], "base": "stations", "main": { "temp": 295.48, "feels_like": 295.41, "temp_min": 295.15, "temp_max": 296.15, "pressure": 1018, "humidity": 60 }, "visibility": 10000, "wind": { "speed": 2, "deg": 260 }, "rain": { "1h": 1.23 }, "clouds": { "all": 100 }, "dt": 1599492273, "sys": { "type": 1, "id": 9029, "country": "RU", "sunrise": 1599446791, "sunset": 1599494929 }, "timezone": 10800, "id": 524901, "name": "Moscou", "cod": 200 } We support the following languages that you can use with the corresponded lang values: sq Albanian ·
🌐
Stack Overflow
stackoverflow.com › questions › 41929396 › how-to-use-openweathermap-api-key
python - How to use openweathermap API Key - Stack Overflow
api_key = "yourkey" base_url = "http://api.openweathermap.org/data/2.5/weather?" city_name = ("example_city") complete_url = base_url + "appid=" + api_key + "&q=" + city_name response = requests.get(complete_url)
🌐
Google
developers.google.com › google maps platform › environment › weather api › set up the weather api
Set up the Weather API | Google for Developers
This document describes the steps needed to start using the Weather API · Ensure that you meet the prerequisites
🌐
O'Reilly
oreilly.com › library › view › hands-on-robotics-with › 9781789342055 › 049cbf3c-c00d-4b63-9653-5d0eb0f2d31e.xhtml
Getting an OpenWeatherMap API key - Hands-On Robotics with JavaScript [Book]
First, you'll need to sign up for an account at https://openweathermap.org/, and generate an API key. Then, click your username in the upper-left corner and select API Keys from the tabs that appear near the top of the page: Generate an API ...
🌐
Bishopg
inspire.bishopg.ac.uk › secure-data › get-your-openweathermap-api-key-a-beginners-guide-1764810184
Get Your OpenWeatherMap API Key: A Beginner's Guide
December 4, 2025 - If you’re starting fresh, look for a button that says something like “Create key”, “Generate key”, or “Get API key”. Click that button. OpenWeatherMap will then generate a unique API key for you.
🌐
Reddit
reddit.com › r/watchfacebuilder › how to set open weather map api key
r/watchfacebuilder on Reddit: How to set Open Weather Map API Key
February 19, 2022 -

Updated: 10/23/2022

OWM's One Call API requires a separate subscription. You will need to subscribe to "One Call by Call" plan, which includes 1,000 API calls per day for free. The watchface will call the API every 30 minutes, or 5 minutes when you moved at least 1km. So at most the watchface will make 288 calls per day, far less than 1,000 limit. Just make sure you don't share your OWM API key with others.

Updated: 8/2/2022

Now you can set the OWM api key in the setting file now. Check this post:Setting file generator (Add OWM API key to your app) : watchfacebuilder (reddit.com)

Updates about PIN -> OWM Key

When watch face app use any of owm data fielda, or owm location name, and if no OWM key was found by app, a PIN window will show up like this:

Make sure the last two lines are all Yes (gps and internet), and I added a count down timer on the face, you then head to Send API Key to Device – Garmin Watchface Online Builder (watchfacebuilder.com) page, and enter the PIN/Key there, and click "Submit"

Wait and check if the key was successfully imported to app. If so, it does, your watch face design should be visible now. But the weather data will take another 5 minutes to arrive.

Add the "Debug Output" on your watch face design. When everything is ok (has GPS location, and with valid OWM key), the "Debug Output" will show nothing. But if there is anything wrong, it will output the error message.

Here is the list of error messages:

  1. no gps

  2. invalid key

  3. no data

  4. over quota

"no gps" means watch face can't get your current location. Please start an outdoor activity and get a lock for GPS, then go back to your watch face to check.

"invalid key" means your entered OWM key is invalid. check if there are any typos.

"no data" means with your owm key and your current gps location, no data is returned from OneCall API. This happened to me a few times. I don't know why, and 30 minutes later it works again.

"over quota" means your API key was used too many time, and it's over quota (1000 calls per day and 60 calls per minutes).

===========

Because sideloaded watch face app does not have access to IQ store, so it doesn't have setting menu. In order to enter your own open weather map API key to your design, here are the steps:

  1. When watchface app is launched without OWM key, the watch face will show a 4 digit PIN. Underneath the PIN, make sure it shows Yes, which indicates the watch has internet connection.

  2. On your computer, go to garmin.watchfacebuilder.com, click "Send API Key" from left, or bookmark this url: Send API Key to Device – Garmin Watchface Online Builder (watchfacebuilder.com)

  3. Select "Open Weather Map", enter 4 digits PIN, and the 32 character length of API key from OWM. (PIN on your device changes every 5 minutes, so make sure the PIN matches)

  4. Click "Submit", then wait.

It will take at least 5 minutes for API key to be save on your device. After the key got pulled to your device, it will take another 5 minutes for weather data shown on your device.

Please add "Debug output" field on your watch to check if all required data are sent over to internet in order to get weather data from open weather map. The required data are:

  1. Valid OWM Key

  2. Valid GPS location

Please use this demo design to check your OWM API key.

OWM API Key Check

When this watch face starts, it will show 4 digits PIN in the middle, and yes or no on the bottom. Make sure it's "Yes".

Go to garmin.watchfacebuilder.com, click "Send API Key", enter your PIN as well as OWM API key, click "Submit".

It will take about 5 minutes, and the PIN screen should go to black screen. Waiting 5 more minute, and your location name should show up on the top, the middle will show your owm API key, lat/lng postion, and the bottom will show the weather condition icon.

During the entire above process, your watch should connect to your phone, and your phone should have internet access.