3

How to get 3,5 or 7 day forecasts from Yahoo Weather API instead of just today and tomorrow?

http://weather.yahooapis.com/forecastrss?w=location gives response which has weather forecast of just today and tomorrow.

In what way we can have more forecasts in the response?

Thanks,

Gaurav Navgire
  • 780
  • 5
  • 17
  • 29

5 Answers5

6

Limit parameter is working fine:

select item.forecast from weather.forecast where woeid in 
    (select woeid from geo.places(1) where text="munic, de") and u='c' limit 3

and URL:

https://query.yahooapis.com/v1/public/yql?q=select%20item.forecast%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22munic%2C%20de%22)%20and%20u%3D%27c%27%20limit%203&format=json
Maciej Miklas
  • 3,305
  • 4
  • 27
  • 52
5

Update : It's not working anymore

It's much easier. Just add the parameter &d=5 to the string, like:

http://weather.yahooapis.com/forecastjson?w=24549429&u=c&d=5 

if you want 5 days. Change json to rss for the RSS version.

Houcine
  • 24,001
  • 13
  • 56
  • 83
chris
  • 59
  • 1
  • 1
3

Not working anymore!


I know it is late and already had an accepted answer. But I will leave my thought just to benefit whoever came to here in search for more info.

Yahoo weather api has another format JSON.

http://weather.yahooapis.com/forecastjson?w=2459115&d=1

This API is undocumented but it will be useful for those who needs more forecasts. Adding parameter "d" will include more forecasts to returned data. I tried with different value for parameter "d". Unfortunately, it will only return forecasts for 4 more days regardless of different values I put in (1,2,3,4,5,a,c,d,...) .However, I believe this should be good enough for most cases.

**Note.. It is not working for rss though.

PH7
  • 3,926
  • 3
  • 24
  • 29
  • 1
    It seems this API is working, but actually the data is incorrect. for example you can compare above link data with "http://weather.yahooapis.com/forecastrss?w=2459115&d=1", the temperature from the json response is incorrect. – flypig Aug 01 '12 at 14:13
  • As of 23 Oct 2012, API I mentioned above is not working anymore. – PH7 Oct 23 '12 at 08:37
2

As stated on the API explanation there are only two parameters: w for the WOEID (where on earth id) and u for the unit (Fahrenheit or Celsius). There are no parameters for the number of days to fetch.

I recommend to switch to some other weather API with more features.

arnep
  • 5,971
  • 3
  • 35
  • 51
  • 2
    This is actually incorrect, there is a hidden parameter for day count as well which isn't documented, however it only seems available for the (also undocumented) JSON version - http://weather.yahooapis.com/forecastjson?w=743334&d=5&u=c – domudall Jul 03 '12 at 14:38
0

Hello all I checked it today you will get maximum of a 10 dyas forcast adding a parameter d. I checked it with 1,2,3..10 and its working perfectly. If you submitt it with 10+ number it only returns 10 days (its maximum).

http://weather.yahooapis.com/forecastrss?w=2442047&u=c&d=10

I checkout with the above url.

Jashan PJ
  • 4,177
  • 4
  • 27
  • 41