New YQL tables for Y! Mail

We are pleased to announce the availability of YQL tables for Y! Mail.

If you (the developer) wanted to use the Yahoo! Mail API before today, you first would have to know the APIs, form the request (JSON/SOAP), and cook it up before sending the request to the server. But that game has just changed.

YQL tables for Y! Mail allow developers to access Y! Mail data using YQL queries. Using the YQL Mail tables, all you need to do is execute one query, for example:

   select * from ymail.messages

This query will get the list of messages from your Inbox (by default). Similarly, to get folders all we need to do is

   select * from ymail.folders

Now, these are simple queries. Imagine you also get the power of mail search with this. For example,

   select * from ymail.messages where attachmenttype='jpeg'


   select * from ymail.messages where query='yahoo'

These queries help you narrow down your search to more granular content.

Y! Mail query in Console

It gets even more interesting if you are able to do subselects — in other words, join two select statements. The input to a GetMessage API is a fid (folder ID) and mid/list of mids (message IDs). This is now possible with a one-line query with YQL. For example,

   select * from ymail.msgcontent where (fid,mids) in (select folder.folderInfo.fid,
mid from ymail.messages where query='Yahoo' limit 1)

and a query that includes social contacts and connections looks like

  select * from ymail.messages where fr in (select fields.value from social.contacts
where guid=me and contact_id in (select contactId from social.connections where owner_guid=me)
and fields.type="email") 

Also, you have options to filter out specific fields that you need in the response. For example,

   select mid from ymail.messages

will just give the message IDs (mid) in the response or

   select folder.folderInfo.fid from ymail.folders

will give only folder IDs in the response.

You can view the tables in the YQL Console.

We’ve currently released three tables. We plan on adding more tables in the near future. If you have any questions, find any bugs, or need any help in writing a specific query, please post it on YDN Forums.

Also, if you have built something cool using these APIs, then post the prototype link in the forums and send us your resume (that is,

Happy hacking!