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 Overflowphp - How to use openweathermap api key? - Stack Overflow
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
python - How to use openweathermap API Key - Stack Overflow
How to set Open Weather Map API Key
Videos
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:
no gps
invalid key
no data
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:
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.
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)
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)
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:
Valid OWM Key
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.