-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functions don't work right now! The error message is: There seems to be no data in the URL. there must be something wrong with the website of wunderground. #39
Comments
there must be something wrong with the website of wunderground. I used to use the URL: https://www.wunderground.com/history/airport/SEA/2014/4/1/CustomHistory.html?format=1 to get historical data. It just doesn't work for me right now and it is also the case with this package. |
This also happened a few months ago, and then wunderground started returning csv data again after a little less than a day. This recent outage started yesterday. I think your URL, apparently taken from the vignette, needs to have the airport as KSEA rather than SEA. I get results in html format if I drop the ?format=1 part, but that isn't helpful without altering the weatherData code to extract the results from the html. https://www.wunderground.com/history/airport/KSEA/2017/9/8/DailyHistory.html works. |
Same here. It was working two days but it stopped working since yesterday. I get the below error message while using both checkDataAvailability and getDetailedWeather functions |
It appears that wunderground is back up. I got a free key to use the wunderground api interface last night, but did not get a chance to check if that interface was returning data during the csv outage or not. |
Seems to have been fixed -- at least for the getWeatherForDate function. |
It still doesn't work for me. Any steps to try and get this to work ? |
library(httr) url = ("https://www.wunderground.com/history/airport/KRNT/2017/1/1/MonthlyHistory.html?") req = GET(url) myStr = strsplit(dat,"Daily Weather History & Observations")[[1]][2] t <- read.csv(textConnection(myStr), header = F) |
Try codes above. It works for me. |
The script still doesn't work for me. myStr returns NA after the first strsplit. Any ideas to get the getWeatherForDate function working. WIll be much smoother. Thanks for your inputs. |
The code is not working, myStr returns NA too! I am wondering if Wunderground page has some updates but we are still waiting for "weatherData" to update? Any ideas? Thank you! |
Hi, Do I need to register for an API key to use this package? Regards, |
I do not believe that weatherData uses the API interface to wunderground. I have been able to get JSON formatted historical data from wunderground all day using the API key, but the site still does not return data in the csv format that weatherData requires (the examples ending in ?format=1 test this). The API interface has a daily limit of 500 single-date queries at a rate not exceeding 10 per minute for the free key. Hopefully this is temporary, perhaps related to recent US weather events driving up query volumes for wunderground. |
The website (wunderground.com) hasn't been down, they have just changed the URL directory structure that the R package weatherData relied on. I am yet to fully understand what has been done and thus the problem still has to be resolved (and neither I could get the httr based solution working). |
If anyone is using rwunderground or directly using the API key, it is useful to know that wunderground resets the quota at midnight US Eastern Time. There is a limit on the number of times you can go over the daily limit, you start with 3 "raindrop" credits to excuse exceeding the limits and avoid denial of service. The credits allow some amount in excess of the limits, my single data point says that 606 requests paced at 10 per minute on a 500 request limit resulted in the loss of one of these "raindrop" credits. |
All, yes looks like WU is no longer making it easy to get CSV files without API's. If anyone figures out a URL for directly fetching CSV's, I will modify the package. But until then, we are stuck. |
This other package works for me! |
Hi everyone, Thanks |
The wunderground.com interface used by weatherdata appears to be defunct. I have written a few routines to retrieve and store (in .rda files) historical data results. These routines are a wrapper for rwunderground functions. Unfortunately, rwunderground historical data fetches fail when all observations have missing visibility data (true for many personal weather stations) and for date/station combinations where there is no data at all. I discovered this yesterday, and wrote a quick patch for the code. |
It seems like Wunderground changed the historical data output, or is not
allowing free downloads w/out an API key anymore?
A few weeks ago when it was still working, I started a project (
https://github.com/andypicke/wunderground_data) to download the historical
data for US airport stations, so I wouldn't have to keep downloading it for
every project I used it in. I wrote my own function to download the data,
which I assume is using the same urls that rwunderground uses behind the
scenes. I haven't tried updating w/ my code recently, but i'm guessing it
probably won't work any more.
Anyways, data up to about a month ago is available in a public S3 bucket.
Details are on my github page.
…On Tue, Sep 26, 2017 at 9:10 AM, Craig Mohn ***@***.***> wrote:
The wunderground.com interface used by weatherdata appears to be defunct.
I have written a few routines to retrieve and store (in .rda files)
historical data results. These routines are a wrapper for rwunderground
functions. Unfortunately, rwunderground historical data fetches fail when
all observations have missing visibility data (true for many personal
weather stations) and for date/station combinations where there is no data
at all. I have discovered this yesterday, and wrote a quick patch for the
code.
I calculate a bit of daily summary data you probably don't need.
You need to get an API key (free up to 500 inquiries per day, less than 10
per minute.
The wrapper code is in my project wunderWrapper.
My updated rwunderground is in a forked version of ALSHum's cran package,
but it doesn't appear to be appropriately visible on github, I will fix
that this evening, when I get home.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#39 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AG6El9U6TQmnoJ-FqMRcm-hStnGh0FGEks5smRPMgaJpZM4PRaky>
.
--
Andy Pickering
andypicke@gmail.com
Linkedin <https://www.linkedin.com/in/andypicke/>
Github <https://github.com/andypicke>
https://andypicke.github.io/
|
@aliceicecream : hey considering your business depends on weather data, you might want to check out Dark Sky and the R @andypicke funny to run into you here :). Cool project, thanks for posting! |
Since it was not working for me I wrote a small web page scraping function in R: getTempData <- function(code, year) { url <- sprintf("https://www.wunderground.com/history/airport/%s/%d/1/1/CustomHistory.html?dayend=31&monthend=12&yearend=%d&req_city=NA&req_state=NA&req_statename=NA", code, year, year) print(url) webpage <- getURL(url) webpage <- readLines(tc <- textConnection(webpage)); close(tc) pagetree <- htmlTreeParse(webpage, error=function(...){}, useInternalNodes = TRUE) parse the tree by tablestablehead <- xpathApply(pagetree, "//table[contains(@id,'obsTable')]/thead/tr/th", xmlValue) results <- xpathApply(pagetree, "//table[contains(@id,'obsTable')]/tbody/tr/td", xmlValue) results = gsub("\n", "", results) Convert character vector to dataframecontent <- as.data.frame(matrix(results, ncol = 21, byrow = TRUE)) colnames(content) <- c("Month", "high", "avg", "low", "high", "avg", "low", "high", "avg", "low", "high", "avg", "low", "high", "avg", "low", "high", "avg", "high", "sum", "evt") return(content) } Far from being perfect but its a good 5 minute start :) |
I recently learned about the following sites: https://mesonet.agron.iastate.edu/request/download.phtml I will work on redirecting WeatherData to this site, when I can. |
@Ram-N Hello! I might have a solution to this issue. I used to write a little R-script myself to get weather data from WU stations. That was about a year ago. This is the URL-structure I used to obtain the desired data: Using this URL-structure, you will get the raw underlying data of the measured weather components as comma seperated values: Time,TemperatureC,DewpointC,PressurehPa,WindDirection,WindDirectionDegrees,WindSpeedKMH,WindSpeedGustKMH,Humidity,HourlyPrecipMM,Conditions,Clouds,dailyrainMM,SolarRadiationWatts/m^2,SoftwareType,DateUTC As far as I can remember I found this link using excel to acess the data table on the desired station-site. Not sure if this works for airports, but definitely for personal weather stations. Maybe this may help you to solve the issue! |
@Ram-N Thanks for your continued work on this package. Might be good to put some kind of note on the CRAN site for the package saying that it's currently not working (I didn't see one there). BTW another option might be the NOAA ftp site: ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/ |
No description provided.
The text was updated successfully, but these errors were encountered: