Skip to content

Instantly share code, notes, and snippets.

@DanBrink91
Created January 10, 2014 23:07
Show Gist options
  • Save DanBrink91/8364435 to your computer and use it in GitHub Desktop.
Save DanBrink91/8364435 to your computer and use it in GitHub Desktop.
import requests
r = requests.get('http://api.openweathermap.org/data/2.5/weather?q=Orland,FL')
print r.json()
@wilderfield
Copy link

{'cod': 401, 'message': 'Invalid API key. Please see http://openweathermap.org/faq#error401 for more info.'}

@DanBrink91
Copy link
Author

They've updated the API and now account is required to use this, follow the link in the message you posted to register and then add the key to request. You should be able to google "python requests api key" to find some examples of others using API keys with this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment