Receive a WOEID by Lat, Long with Yahoos API

后端 未结 11 1913
北荒
北荒 2020-12-07 17:57

i searched a while but found nothing, thats simular to my problem.

i\'m trying to use the YAHOO Weather API, for example: http://weather.yahooapis.com/forecastrss?w=

11条回答
  •  既然无缘
    2020-12-07 18:52

    The former Yahoo Weather API has became deprecated. The new Yahoo Weather API requires a query string to get weather.

    Use the following query string to get weather data by latitude and longitude -
    "https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid in (select woeid from geo.places(1) where text=\"(" + latitude + "," + longitude + ")\")&format=json"

    Eg - https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22(31.63%2C74.87)%22)&format=json

提交回复
热议问题