yqlyahoo-weather-api

Get Weather information using Yql query lat,long parms


I am using the following YQL query to get weather information

http://query.yahooapis.com/v1/public/yql?q=select%20item%20from%20weather.forecast%20where%20location%3D%2248907%22&format=json

Is there any way to get weather information using longitude, latitude as YQL query parameter.


Solution

  • You could use a sub-select to go from a latitude/longitude pair to a WOEID like

    SELECT * FROM weather.woeid 
    WHERE w IN (
        SELECT place.woeid 
        FROM flickr.places(1) 
        WHERE (lat,lon) in (55.948503,-3.198931)
    );
    

    (Try in YQL console)