you can still get free access to the OpenWeatherMap basic weather data for free, as long as you don't go over 1000 calls per day (and you can set the limit in the account settings)? Yes and yes. It does need a credit/debit card to be saved though even if you cap requests at the free 1000/day. Alternatives are Pirateweather and Open-Meteo. Answer from RPC4000 on reddit.com
🌐
Reddit
reddit.com › r/ubersicht › 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
r/Ubersicht on Reddit: 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
January 22, 2023 - I’d recommend you don’t include keys in screenshots like this. You probably want the OneCallAPI which was designed specifically for people moving from darksky. It’s very similar, and the only differences are improvements in my opinion. https://openweathermap.org/api/one-call-3 · It’s free ...
🌐
Reddit
reddit.com › r/python › open weather map project | free to use code | help improve code
r/Python on Reddit: Open Weather Map Project | Free to use code | Help improve code
August 11, 2023 -

Save this in a file ex filename.py I would suggest using VSCode.

Get you API key for free from https://openweathermap.org/api (This is not an advertisement this is a fun project) Replace the value of variable "Key" with the key that you got in double or single quotes.

Then make another file named Functions.py exactly if you really want to change the name, go to the 4th line (Including Spaces) and change the "import Functions as Geocode" to "import {name here} as Geocode"

Here have the code:

____________________________________________________________________________________________________________

filename.py

import requests
import Functions as Geocode
# File check functions


# Variables
Key = 'Your key goes here'

# Geocoding Setup
countryCode = input("Enter the country code of your country (IN for India):")
Zip = input("Enter the zip code of your city:")
City = Geocode.City(Key, countryCode, Zip)
lat = Geocode.Latitude(Key, countryCode, Zip)
lon = Geocode.Longitude(Key, countryCode, Zip)

CurrAirPol = f'http://api.openweathermap.org/data/2.5/air_pollution?lat={lat}&lon={lon}&appid={Key}'

AQI = Geocode.CurrentAirPollution(CurrAirPol)
print(AQI)

End of Code here!

____________________________________________________________________________________________________________

Functions.py

import requests


def City(Key, countryCode, Zip):
    Geocoding = f'http://api.openweathermap.org/geo/1.0/zip?zip={Zip},{countryCode}&appid={Key}'
    response = requests.get(Geocoding).json()
    print(f"Are you trying to access the data of {response['name']}")
    return response['name']


def Latitude(Key, countryCode, Zip):
    Geocoding = f'http://api.openweathermap.org/geo/1.0/zip?zip={Zip},{countryCode}&appid={Key}'
    response = requests.get(Geocoding).json()
    return response['lat']


def Longitude(Key, countryCode, Zip):
    Geocoding = f'http://api.openweathermap.org/geo/1.0/zip?zip={Zip},{countryCode}&appid={Key}'
    response = requests.get(Geocoding).json()
    return response['lon']


def CurrentAirPollution(Path):
    response = requests.get(Path).json()
    AQI = response['list'][0]['main']['aqi']

    CO = response['list'][0]['components']['co']
    print(f'Carbon Monoxide = {CO}')

    NO = response['list'][0]['components']['no']
    print(f'Nitric Oxide = {NO}')

    NO2 = response['list'][0]['components']['no2']
    print(f'Nitrogen Dioxide = {NO2}')

    O3 = response['list'][0]['components']['o3']
    print(f'Trioxygen = {O3}')

    SO2 = response['list'][0]['components']['so2']
    print(f'Sulfur Dioxide = {SO2}')

    PM = response['list'][0]['components']['pm2_5']
    print(f'Dangerous: PM2.5 = {PM}')

    PM10 = response['list'][0]['components']['pm10']
    print(f'Dangerous: PM10, Particulate Matter = {PM10}')

    NH3 = response['list'][0]['components']['nh3']
    print(f'Azane = {NH3}')

    if AQI >= 1 and AQI <= 3:
        return f"Bad Air Quality, Air Quality = {AQI}"
    elif AQI >= 4 and AQI <= 6:
        return f"Moderate Air Quality, Air Quality = {AQI}"
    elif AQI >= 7 and AQI <= 9:
        return f"High Air Quality, Air Quality = {AQI}"
    else:
        return f"Very High Air Quality, Air Quality = 10"

End of Code

____________________________________________________________________________________________________________

Note: This will display all of the things like how much carbon monoxide and stuff, I am not good at chemistry so I googled all of the chemical names sorry ):

Hope this helps you all beginners to getting a good idea of how much pain I felt making this CurrentAirPollution Functions cus too many errors started coming but I came up with this. Please don't be arrogant like me I suffered a lot, 2 hours of work );

Send help

Regards.

🌐
Reddit
reddit.com › r/webdev › best free weather api? (also lol at openweathermap's pricing)
r/webdev on Reddit: Best free weather API? (also LOL at openWeatherMap's pricing)
November 19, 2020 -

I found a decent free tier API that gives some hourly forecast data (openWeatherMap.com). It's pretty decent, but I started looking at their pricing for paid plans, and like, holy FUCK the "developer" plan is $180 per month! for a weather api? with limited endpoints? Why would anyone pay that much?

What's your favorite free weather API?

EDIT: I ended up going with weatherapi.com. Their endpoints are much more detailed than other options and offer 3 days of hour-by-hour forecast data on free tier, which is best in class.

🌐
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 16, 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.

🌐
Reddit
reddit.com › r/homeassistant › openweathermap api 3.0 requires a credit card - will you be switching?
r/homeassistant on Reddit: Openweathermap API 3.0 requires a Credit Card - Will you be switching?
June 7, 2024 -

OPENWEATHERMAP API V2.5 DEPRECATION

OpenWeatherMap API V2.5 will be closed in June 2024. After this date, you will need to use API V3.0.

To continue using the service:

Visit the OpenWeatherMap website and activate the One Call subscription.

During activation, you will be prompted for a credit card, but you will not be charged unless you exceed the free tier limits.

Configure your OWM integration to select mode v3.0.

Note: Subscription activation may take up to 2 hours.

I'm wary of linking a credit card to yet another service with the intent of maintaining free service requirements. Curious if others share this sentiment and which weather services people use in the USA? I have quite a few scripts and automations using weather data that will require manual migration.

Find elsewhere
🌐
Reddit
reddit.com › r/learnprogramming › is there a free and accurate weather api
r/learnprogramming on Reddit: Is there a free and accurate weather API
July 26, 2024 -

I tried OpenWeatherMap but I need to put a credit card in and I don't have that right now. I also tried weatherstack but the info it gave me was wrong. Meteo wants a free trial.

Are there alternative weather API that are free and accurate without having put credit details in?

🌐
Reddit
reddit.com › r/scriptable › does anyone here use “weather by cal” or the openweatherapi and know how to help me? details in comments
r/Scriptable on Reddit: Does anyone here use “weather by cal” or the openweatherapi and know how to help me? details in comments
July 12, 2022 - You have to give them your CC, but it's basically free if you don't exceed 1,000 calls per day. Looking at my daily stats - the widget makes less than 100 calls a day, so seems to be safe with the free limit.
🌐
OpenWeatherMap
openweathermap.org › appid
How to start to work with Openweather API
Your API keys can always be found on your account page, where you can also generate additional API keys if needed. Check our documentation page to find all technical information for each product.
🌐
GitHub
gist.github.com › lalithabacies › c8f973dc6754384d6cade282b64a8cb1
Open weather API key · GitHub
Please choose the proper subscription https://openweathermap.org/price"} ... Thanks, still works properly. ... Still working, 3/16/2026. Thank you! :) ... Подтверждаю, работает, спасибо! Взял для стороннего циферблата garmin, оригинальная погода врет:( Sign up for free to join this conversation on GitHub.
🌐
OpenWeatherMap
openweathermap.org › faq
Frequently Asked Questions
Please, check your right API key in personal account. You are using a Free subscription and try requesting data available in other subscriptions . For example, 16 days/daily forecast API, any historical weather data, Weather maps 2.0, etc).
🌐
Internet Archive
archive.org › software
Open Weather Map API Key : Openweathermap : Free Download, Borrow, and Streaming : Internet Archive
February 3, 2022 - Free OpenWeatherMap API Key. No sign up required, just use the key. Valid as of...
🌐
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')
🌐
Reddit
reddit.com › r/webdev › free weather api for non-commercial use
r/webdev on Reddit: Free weather API for non-commercial use
November 29, 2021 - Hi! First time posting here. I created a simple free weather API. It does not require an API key for non-commercial use. I have a build a simple API…
🌐
Reddit
reddit.com › r/learnpython › invalid api key error for open weather ( free ) api error, despite using a valid key
r/learnpython on Reddit: Invalid API key error for Open Weather ( free ) API error, despite using a valid key
April 2, 2021 -

I tried to run a short program from the book Automate The Boring Stuff With Python, and, my result doesn't match the result predicted by the book. Here's the code:

import requests,json,sys

APPID ='7b26c92417fd3678d52eac12dc870222'

if len(sys.argv) < 2:
    print('Usage: getOpenWeather.py city_name, 2-letter_country_code')
    sys.exit()
location = ''.join(sys.argv[1:])

#Download the JSON data from OpenWeatherMap.org's API.
url = f'https://api.openweathermap.org/data/2.5/forecast/daily?q={location}&cnt=3&APPID={APPID}'
response = requests.get(url)
response.raise_for_status()

#Uncomment to see the raw JSON text:
#print(response.text)

#Load JSON data into a Python variable.
weatherData = json.loads(response.text)

#Print weather descriptions
w = weatherData['list']
print('Current weather in %s:'%(location))
print(w[0]['weather'][0]['main'],'-',w[0]['weather'][0]['description'])
print()
print('Tomorrow:')
print(w[1]['weather'][0]['main'],'-',w[1]['weather'][0]['description'])
print()
print('Day after tomorrow:')
print(w[2]['weather'][0]['main'],'-',w[2]['weather'][0]['description'])

The response I got was:

Traceback (most recent call last):
  File "C:\Users\Vesna\PycharmProjects\getOpenWeather.py", line 13, in <module>
    response.raise_for_status()
  File "C:\Users\Vesna\AppData\Roaming\Python\Python39\site-packages\requests\models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.openweathermap.org/data/2.5/forecast/daily?q=Belgrade,Serbia&cnt=3&APPID=7b26c92417fd3678d52eac12dc870222

Then I commented out the raise_for_status function, and added a print statement regarding the response object from the API call ( just uncommented it ), and got this instead:

{"cod":401, "message": "Invalid API key. Please see http://openweathermap.org/faq#error401 for more info."}
Traceback (most recent call last):
  File "C:\Users\Vesna\PycharmProjects\getOpenWeather.py", line 22, in <module>
    w = weatherData['list']
KeyError: 'list'

Both messages allude to the same perceived root cause: lack of valid API key. However, this is just not the case. According to the website I used ( open weather ), a few things could cause the given error ( 401 ): invalid API key, not enough time spent after generating your first key, and trying to access premium services. I did get a valid API key, and even generated another one just to test it out ( with no different result ), I waited hours after my first attempt, so the possibility of my key not yet having finished the process of authorization is minimal, and I've checked multiple time which API services I requested, and they were the free ones ( current weather ) ONLY.

I have no idea what could be causing this error, and would immensely appreciate it if anyone helped me out with this, if they spot or know something I don't.