This tutorial shows you how to run YQL statements and examine the resulting data with the YQL Console.
select * from flickr.photos.search where text="Cat" limit 10
This SELECT statement requests Flickr photos of cats. The "*" indicates that all
fields of the flickr.photos.search
table will be returned. In the filter
of the WHERE clause, the string "Cat" is the value of the search query.
flickr.photos.search
table is in the
results
element. To get the response in JSON format, select the JSON radio button and click TEST.
owner
and title
fields:
select owner, title from flickr.photos.search where text="Cat" limit 10
Make sure that owner
and title
are lowercase.
Unlike SQL, in YQL the field and table names are case sensitive.
photo
fields should
only have the owner and title
attribute fields.
http://query.yahooapis.com/v1/public/yql?q=select%20owner%2C%20title%20from%20flickr.photos.search%20where%20text%3D%22Cat%22%20limit%2010&format=json&callback=cbfunc
To call the YQL Web Service, an application would call an HTTP GET
method on this URL. The q
parameter in the URL matches the SELECT
statement displayed under Your YQL Statement (except that
characters such as spaces are URL encoded). The COPY URL
button copies this URL to your clipboard, so that you can paste it into the source code of
an application.
flickr.photos.search
, then click desc.
On the TREE VIEW tab, take a look at these nodes:
"query->results->table". The nodes under the "table" node contain information such as
meta-data and search fields (input keys). For more information on input keys, see Remote Filters.