Skip to content

Using wunderground API

David Shi edited this page Apr 3, 2017 · 3 revisions

As of April 3, 2017:

In order to use wunderground, you must first obtain a key for development. We went with the free option, of course, which limits calls per day to 500 and calls per minute to 10. Thankfully, we don't need nearly that many requests and only call once per hour.

Pulling every hour, we most importantly need 'current_observation' from the JSON response.
Here's an example of pulling the precipitation over the past hour in inches:

response = requests.get(url)
rain_inches = float(response.json()['current_observation']['percip_1h_in']

Note that your URL is your specific query that you can/should build for your own purposes.

And that's it. The requests are much easier to navigate compared to USGS's formatting

Clone this wiki locally