Yahoo Query Language (YQL)... Location ID vs WOEID for International Weather

UPDATED BELOW

 

OK - so I just started messing about with YQL on the Yahoo developer site, using the YQL console which is pretty awesome - it allows you to use a SQL variant to query the vast XML data sources.

I am interested in weather - in Canada, specifically.  Which sucks - because the weather part of the API is tuned to zip codes (US only), and even the RSS feed for Canadian locations use some other proprietary location code.  For example, here is the RSS for weather in Toronto:  http://xml.weather.yahoo.com/forecastrss?p=CAXX0504&u=c.

Why doesn't this use the WOEID (where on earth id) which is returned from THIS call in YQL:

image

 

But you can't use that WOEID to get the weather - you need a zip code or a location id.  That stinks.  The call below works (somewhat) but it is somewhat insufficient, if you ask me.

 

image

This whole thing is a bit half baked unless they add WOEID support to everything (maybe they did and I missed it...).

YQL is pretty awesome, but I think it needs work.

 

more later - joel

 

UPDATE: Ok - I kept digging and found this blog entry by Jonathan Trevor - whom I presume is a developer involved with Yahoo.  It shows us that we can do this:

select * from weather.forecast where location in
   (select id from xml where
    url="http://xoap.weather.com/search/search?where=Toronto"
    and itemPath="search.loc")
 

Notice the external URL that we are calling to resolve the location ID?  NICE!  I take it all back.

Published Wednesday, December 03, 2008 2:06 PM by joelvarty

Comments

# re: Yahoo Query Language (YQL)... Location ID vs WOEID for International Weather

Wednesday, January 27, 2010 7:37 AM by liujuncong@gmail.com

Such good article!

# re: Yahoo Query Language (YQL)... Location ID vs WOEID for International Weather

Wednesday, March 24, 2010 2:03 PM by HB

Looks like your wish came true in this case, the weather API now requires WOEID and no longer accepts zip code.

# Yahoo Location Code | More More Pics

Wednesday, March 30, 2011 4:06 AM by Yahoo Location Code | More More Pics

Pingback from  Yahoo Location Code | More More Pics

Leave a Comment

(required) 
(required) 
(optional)
(required)