I am developing a web portal consuming the Yahoo web service for the real-time temperature. I was using combined YQL query to fetch the weather data by latitude and longitude which was not bad:
https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid in (select woeid from geo.placefinder where text='lat,lon')&format=json
Since this January, the combined query did not work anymore. Therefore, I had to make two separate http requests in sequence to get the data.
- Get woeid from lan, lon and appid
- Get data from woeid
It is quite time-consuming and less efficient to fetch the data from Yahoo each time. I have been googled a while for a solution to improve this but most of them are for old Yahoo weather API versions. I am looking for an way to shorten the time or some other mainstream free weather service providers, offering world weather.
Update (2016.03.24)
I found a way to make the combined YQL work from this thread.
Change the YQL to:
https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid in (select woeid from geo.placefinder where text='(lat,lon)')&format=json
Just need to add brackets round the geo location. The previous one used to work util recently.
Update (2016.03.25)
The yahoo weather service was down yesterday and the YQL was invalid for quite a while.
From it official document, it says that it had enforced Oauth 1 since March 15 via the url https://query.yahooapis.com/v1/yql?q=...
Even though the public link was back today, I found that I was unable to switch weather unit by adding u='c' or u='f'.
I don't know whether Yahoo weather API will continue to maintain the old url or not. For the time being, it is still alive. I am looking forward to a solution to query Yahoo weather by Oauth 1.0 in Javascript.