Yahoo weather api, how to fetch condition icons by condition code?

Viewed 1631

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?

2 Answers

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.

Related