Friday, January 9th, 2009
Yahoo! Query Langauge is one of those wonderful ideas that you wish you’d thought of yourself. Take the various disparate APIs from Yahoo products and give them a unified SQL-like method of querying. Lots of data made easier to use and accessible through a more standard approach, so:
select * from flickr.photos.interestingness(10)
Gets you 10 interesting photos from Flickr. Nice and simple if you know SQL, and many web developers do.
I’ve done some playing with the various APIs Yahoo’s products make available, but hunting through varying bits of documentation was a pain, and they all worked slightly differently, so this is a really helpful single point of contact.
But that’s just the surface layer, it gets more interesting digging in a bit. YQL also allows you to query external data like any RSS feeds, CSV files, JSON and so on. It’s like Yahoo Pipes in this way, only less visual. One of the data options is to pull other people’s (X)HTML and run XPATH on it. So I could get all the anchors within H2s on this page with:
select * from html where url="http://eclecticdreams.com" and xpath='//h2/a'
So it acts as a nice middleman for data from pages with half-decent semantics. You could grab Microformat rich material, for example, and then mix them in with other data. Which means again, a lot more data in one place, with one interface, where I can hack it together using a language I’m already half familiar with.
That makes mashing things up a lot less headachey.

January 9th, 2009 at 12:09 pm
I remember seeing a very early prototype of YQL from one of the senior engineers (Ric Allinson) at my first Y! Internal Hack Day.
Needless to say, it got a huge round of applause – if I’m not mistaken, it might even have won the competition.
I agree – its a very clever concept and can really speed up the development process when accessing external data from other sources. Maybe we could experiment with YQL at the Multipack Hack Day (tbc)?
January 9th, 2009 at 10:00 pm
I think that would be an excellent idea!
We should probably start a thread about that on the forums.
October 8th, 2009 at 3:21 pm
YQL is for sure a great idea, when I started playing around with it I found I kept making mistakes in my query urls (its easy to do!) so I put together a fast and easy to use wrapper for it. you can do and Xpath query like you have above with 3 lines of code:
// Create an XML Document
XmlDocument xmlDoc = new XmlDocument();
// Create our Query Object
YqlQuery XpathQuery = new YqlQuery();
// Do our xpath Query.
xmlDoc = XpathQuery.GetXPath(“//h2/a”, “http://eclecticdreams.com”, “*”);
You now have an Xml Document with the results.
I have put this onto sourceforge check it out
http://sourceforge.net/projects/yqlwrapper/files/
Enjoy.