开发者

Undocumented Yahoo! Weather API?

开发者 https://www.devze.com 2022-12-17 15:42 出处:网络
According to the Yahoo! Weather API documentation, a WOEID must be provided to obtain weather information for a specific region. The WOEID can be obtained by using the Yahoo! GeoPlanet service.

According to the Yahoo! Weather API documentation, a WOEID must be provided to obtain weather information for a specific region. The WOEID can be obtained by using the Yahoo! GeoPlanet service.

If I have a zip code, this is two API calls to obtain weather information.

Get the WOEID from a zip code: http://where.yahooapis.com/v1/places.q(19146)?appid=...

Get th开发者_如何学Goe weather info using WOEID: http://weather.yahooapis.com/forecastrss?w=12765532

However, after some web crawling I found that you can do the exact same thing with one API call:

http://xml.weather.yahoo.com/forecastrss?p=19146

I couldn't find any documentation on this. Is it safe to use in a production application?


the api documentation says:

Note: The old location parameter 'p' has been deprecated and will be removed in the future releases. Hence users are encouraged to migrate to the 'w' parameter which provides deep integration into Y! GeoPlanet. The old documentation is archived here.

so: using p doesn't seem to be the best idea for production code to me.

0

精彩评论

暂无评论...
验证码 换一张
取 消