4

I'm trying to find links to weather condition images for Yahoo weather api. I get condition codes in JSON response, guess images are based on them. Like for OpenWeatherMap you add condition code to main URL http://openweathermap.org/img/w/(conditionCode)

How to do that for yahoo images?

Jim H.
  • 285
  • 1
  • 2
  • 15

2 Answers2

5

Link to the images is embedded in the api response down somewhere in description element. Add code number accordingly and download the image

http://l.yimg.com/a/i/us/we/52/(code_number).gif

Jim H.
  • 285
  • 1
  • 2
  • 15
4

Not sure why the question has been downvoted, I had a similar question and this helped, but the other answer didn't work for HTTPS.

For HTTPS: Night time image:

https://s.yimg.com/zz/combo?a/i/us/nws/weather/gr/28n.png

Day time image:

https://s.yimg.com/zz/combo?a/i/us/nws/weather/gr/28d.png

You will see that the last number (28 in this example) is the condition code from the Yahoo API Response plus a code to represent day 'd' or night 'n'.

I noticed the images are quite different, firstly they are PNG's but they are also larger and include transparency.

Jim H's answer is correct for HTTP.

TimW
  • 126
  • 4