Search code examples
yqlyahoo-weather-api

Yahoo Weather Query by Latitude and Longitude


I want to fetch some weather data via latitude and longitude using yahoo query. but it seems this query is not available now. the query is below:

select * from weather.forecast where woeid in (SELECT woeid FROM geo.placefinder WHERE text="{lat},{lon}" and gflags="R")

is this query is changed to new one or something? or it didn't exist anymore? last time I use this format was about 2 months ago and it worked well. but now it can't fetch any data. result from YQL console is as below:

{
 "error": {
  "lang": "en-US",
  "description": "Tenant 'query_yahooapis_com' access to 'Resource [tenantName=query_yahooapis_com, type=TABLE, name=geo.placefinder, locatorType=FILE, url=/home/y/share/manhattan/application/tenantBundles/yql_query_yahooapis_com_manhattan_v2/YQL-INF/restdefs/geo.placefinder.xml, useUrl=false]' is denied."
 }
}

I already make some research, including this post: How to get Yahoo's woeid by location?

Is that true that yahoo already terminate this latitude longitude query for fetching weather?


Solution

  • According to the latest reply to this answer, you should switch to the table geo.places and remove the gflags="R" part. I tried it in the YQL console and it seems to work:

    select * from weather.forecast where woeid in (SELECT woeid FROM geo.places WHERE text="(latitude,longitude)")