talkpython / 100daysofweb-with-python-course

Demo code and resources for our 100 Days of Web in Python Course
https://training.talkpython.fm/courses/explore_100days_web/100-days-of-web-in-python
631 stars 391 forks source link

Day 23: openweathermap.org requires API key now #7

Open ericchou1 opened 5 years ago

ericchou1 commented 5 years ago

It seems staring October 9th, 2015, openweathermap.org requires API key for access, therefore returning an error:

requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.openweathermap.org/data/2.5/weather?zip=90210,us&appid=

Per https://openweathermap.org/faq#error401: "Starting from 9 October 2015 our API requires a valid APPID for access. Note that this does not mean that our API is subscription-only now - please take a minute to register a FREE account to receive a key."

The location, sun, and events services still work when testing.

Perhaps make a note during screencast to indicate try the other APIs other than weather or take it out completely in example code?

mikeckennedy commented 5 years ago

Thanks for pushing this my way @bbelderbos

Grr. I HATE external APIs. Just today I got a message that I need to write the error tracking in our mobile apps because Azure integration APIs are deprecated and need to move to the new one. Where is the backwards comp here? -- Side rant...

More to the point, let me see what I can do that will require a minimal change. IIRC, we really only used the sunrise / sunset info in the final code.