Historical data for multiple days in one request ?

  • 41
  • Question
  • Updated 4 weeks ago
Is there a way to get historical data for multiple days in one request ?

There is hourly10day which returns an hourly forecast for the next 10 days.

Is there something similar for historical data ?

For history history_YYYYMMDD returns a summary of the observed weather for the specified date but is it possible to get history data from one date to another date.
Photo of santoshb

santoshb

  • 23 Posts
  • 0 Reply Likes

Posted 6 years ago

  • 41
Photo of runamokisay

runamokisay

  • 4 Posts
  • 1 Reply Like
I am interested in this too! How about, say, the weather on July 6 from 1975-2012?
Photo of MightyMint

MightyMint

  • 2 Posts
  • 1 Reply Like
I notice this has been on for three months. I could really use this feature. Did anyone get an answer / solution?
Photo of runamokisay

runamokisay

  • 4 Posts
  • 1 Reply Like
I got an answer after posting a separate question. Basically, they refuse to support this feature.
Photo of runamokisay

runamokisay

  • 4 Posts
  • 1 Reply Like
I got an answer after posting a separate question. Basically, they refuse to support this feature.
Photo of MightyMint

MightyMint

  • 2 Posts
  • 1 Reply Like
Protecting the income stream I guess! The historical data cost is expensive compared to the "live" data.
Photo of joshlehman

joshlehman

  • 2 Posts
  • 2 Reply Likes
This is a real shame since it is highly inefficient (even for a paying customer) to make 365 separate API calls to get just a single year's worth of historical weather data for one location.
Photo of altaibayar tseveenbayar

altaibayar tseveenbayar

  • 1 Post
  • 3 Reply Likes
joshlehman: you should store all results in database, so 365 requests will be done just once.
Photo of Stefano Campagnolo

Stefano Campagnolo

  • 1 Post
  • 0 Reply Likes
can you better explain please?
Photo of Wolf_Bomber

Wolf_Bomber

  • 1 Post
  • 0 Reply Likes
I would love to know the API which can do the job for a Weather Info on the present week. How can i get it done with a single API? I need it asap. :(
Photo of TireSafety

TireSafety

  • 2 Posts
  • 0 Reply Likes
It appears that this feature can be accomplished in some manner with the Planner feature: See http://www.wunderground.com/weather/a...

It is unclear though whether you can use it for more than the previous year.
Photo of tvor51

tvor51

  • 2 Posts
  • 2 Reply Likes
I wrote this in Python 2.7 to generate a barometric pressure graph.
from json import loads
from urllib2 import urlopen
from datetime import datetime, timedelta

def download_json(url):
weather = urlopen(url)
string = weather.read()
weather.close()
return loads(string)

d,x,y=[],[],[]
x1 = 0.0
key = 'Your key here'
for day in range(4,-1,-1):
url = ''.join(['http://api.wunderground.com/api/', key,
'/history_',
(now-timedelta(days=day)).strftime('%Y%m%d'),
'/q/TX/Addison.json'])
data = download_json(url)
for k in data['history']['observations']:
y0 = float(k['pressurem'])
if y0 < 0.0:
continue
else:
x.append(x1 + float(k['date']['hour'])+
round((float(k['date']['min'])/60.0),2))
y.append(y0)
x1 += 24.0
Photo of Sri Krishna

Sri Krishna

  • 2 Posts
  • 0 Reply Likes
@ tvor51,
Thanks for the response in Python, i need some time to decode the snake! But the basic principle you used here for the generation of the Web-URL to request the WunderGround Services rely on Python code? Then please provide me the same in URL format using dummy App Key. I need it asap, i would be grateful. and if possible guide me to some information links to master the beast (Weather Service) using the Python Scripts.
Photo of tvor51

tvor51

  • 2 Posts
  • 2 Reply Likes
@Sri Krishna, not sure what it is that you need. The function download_json takes the URL stored in variable url, where variable key is your App Key. ''.join() is a Python function that joins a list of strings into a single string.
I added this to a program I found and modified that created a weather display for the Amazon Kindle. http://blog.volcanis.me/hack/2012/12/...
Photo of fearless_fool

fearless_fool

  • 13 Posts
  • 7 Reply Likes
For PWS stations, you can do things like:

http://www.wunderground.com/weatherst...

to get the raw CSV data. For airports, the format is a little different:

http://www.wunderground.com/history/a...

Is that what you were looking for?
Photo of WunderWilliam

WunderWilliam

  • 7 Posts
  • 1 Reply Like
We don't have a built-in function to get data for more than one day -- each history call is for one day.

Many of our API users create a script to automatically increment the date, and repeat the call. This is the easiest way to get a large date spread.

-William
Wunderground Support
Photo of teppattra

teppattra

  • 4 Posts
  • 0 Reply Likes
fearless_fool what program language do you use for saving data to csv file? I try C# what I get just the first line of data. One more question, what format=1 means?
Photo of fearless_fool

fearless_fool

  • 13 Posts
  • 7 Reply Likes
Well, your choice of language isn't so much an issue as your choice of library function in your language. I've used both Ruby and Python for reading and manipulating CSV files, but I'm absolutely certain that C# has libraries to work with CSV files (but I'm not much help on the particulars).

And in this context, format=1 means CSV format.
Photo of teppattra

teppattra

  • 4 Posts
  • 0 Reply Likes
Thanks for quick reply, fearless_fool :-)
Photo of Mayan Whitewater

Mayan Whitewater

  • 1 Post
  • 0 Reply Likes
Hi, is there documentation for the WXDailyHistory (or other) function (the various formats for example)? And is it true, access to PWS data is unlimited? you don't need an api id/account?
Photo of ghedger

ghedger

  • 5 Posts
  • 1 Reply Like
"I got an answer after posting a separate question. Basically, they refuse to support this feature."

Then Weather Underground is completely worthless to us and I'm sorry that I signed up.

We'll find what we need elsewhere.
Photo of fearless_fool

fearless_fool

  • 13 Posts
  • 7 Reply Likes
@ghedger: Before you write off Weather Underground, did you try the URLs I gave in my answer? I've been using this technique and it works well.
Photo of ghedger

ghedger

  • 5 Posts
  • 1 Reply Like
I'll give it a chance.

Thing is, it needs to be a quick response suitable for realtime user queries.

It's either quick, or we'll need to scrape it ourselves.

We have, BTW, all the weather data for zip codes. It's just wind speed that' s the problem - esp. gust speed because of the cubic relationship between wind and power generation.

Thanks!
Photo of fearless_fool

fearless_fool

  • 13 Posts
  • 7 Reply Likes
@ghedger: when you say "quick response" do you mean low latency from the wunderground servers? If so, the CSV interface is very fast.

If by "quick response" you instead mean finer granularity than daily average, then you can get reports with about five minute granularity. Ping me if you want the recipe for that (but I'll bet you can figure it out pretty easily).

Best,

- Rob
Photo of ghedger

ghedger

  • 5 Posts
  • 1 Reply Like
Hi Rob, I found what I needed a month ago from government sources. It turned out to be more complex, requiring a different type of database, but it works. Many thanks!
Photo of fearless_fool

fearless_fool

  • 13 Posts
  • 7 Reply Likes
That's great news! Would you care to share a pointer to the government sources? In my work, more data is better... :)
Photo of ghedger

ghedger

  • 5 Posts
  • 1 Reply Like
I'll try to dig for them later. Currently embroiled in another problem.
Send me a private e-mail and we can talk more on this if you're interested.
Photo of fearless_fool

fearless_fool

  • 13 Posts
  • 7 Reply Likes
I AM interested, but I don't see how to do a private e-mail using the forum tools. Can you PM me at rdpoor [atsign] gmail dot com so we can discuss later? Thanks.
Photo of Eweglobal

Eweglobal

  • 1 Post
  • 0 Reply Likes
I'm also interesting in getting an historical month only in one request.
Photo of mjlewis

mjlewis

  • 0 Posts
  • 0 Reply Likes
Is there a wget option to retrieve multiple days in one request. I used the command wget http://www.wunderground.com/weatherst... but I did not get a csv data file.
Photo of fouroneone

fouroneone

  • 3 Posts
  • 1 Reply Like
I've found most of what I want, emailed to me conveniently, on the Utah Climate Center Website at Utah State University:

http://climate.usurf.usu.edu/mapGUI/m...
Photo of MichaelWray

MichaelWray

  • 1 Post
  • 0 Reply Likes
I'm trying to get historical data by zip code within the US for the past year (since June 2013 or so). Is this possible? How do I go about doing it?
Photo of WunderWilliam

WunderWilliam

  • 267 Posts
  • 17 Reply Likes
You can get historical data via zip code, but only one date at a time.

Most users create a script for this purpose that automatically increments the date between calls.
Photo of teppattra

teppattra

  • 4 Posts
  • 0 Reply Likes
hi WunderWilliam, hope you can help me... I try to save the history from this url http://www.wunderground.com/weatherst...

but what I get just one blank line and one header line. I debug the program which is C#. What I find is data contain

"\
nDate,TemperatureHighC,TemperatureAvgC,TemperatureLowC,DewpointHighC,DewpointAvgC,DewpointLowC,HumidityHigh,HumidityAvg,HumidityLow,PressureMaxhPa,PressureMinhPa,WindSpeedMaxKMH,WindSpeedAvgKMH,GustSpeedMaxKMH,PrecipitationSumCM
\n"

Can you give me some advice to solve this problem?

thank you in advance.
Photo of bidgely

bidgely

  • 2 Posts
  • 0 Reply Likes
Why can't wunderground provide this? If its purely a money aspect, you could always offer a way to download 1 year worth of historical data and count it as 365 API calls but return it in a single HTTP response. Its just so so inefficient the current way...
Photo of Cody

Cody

  • 1 Post
  • 0 Reply Likes
I was interested in this as well, but only out of personal curiosity.. so setting up a loop to do repeated calls isn't a big deal.. If you decide to go that route, under a free license, don't forget to set a timer so you don't exceed the 10 calls per min/500 per day limit.