Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

YQL & Yahoo! Apis


Published on

The YQL & Yahoo! Apis presentation done in RHOK Bangalore

Published in: Technology, Design
  • Be the first to comment

  • Be the first to like this

YQL & Yahoo! Apis

  1. 1. YQL & YAHOO! APIS Jai Santhosh Frontend Engineer, Hacker Yahoo!
  2. 2. What We’re Going to Cover• YQL Overview• Making Queries and the Console Sandbox• Demo• Open Data Tables and Execute (Server-Side JavaScript)• Final Lessons
  3. 3. Data manipulationHacks = + Data visualization
  4. 4. The web is a large pile of data!
  5. 5. – 4480 Apis
  6. 6. Yahoo! has alsoopened up its data
  7. 7.
  8. 8. Trouble with Data• Need to find data API• Get Access – Signup for key• Find data endpoint• Read docs to learn what parameters you have• Get data in obscure format• Use data after converting and filtering• More APIs you use, more is your annoyance
  9. 9. To make data access easy on the web, Yahoo! created YQL
  10. 10. =YQL turns web services and data on the web into databases.
  11. 11. select {what} from {where} where {conditions}
  12. 12. You can select, filter, sortand limit data and you can even insert, update and delete from it.
  13. 13. YQL:
  14. 14. Finding Videos about Bangalore• SELECT * FROM where query=bangalore
  15. 15. Selecting Photos of RHOK• SELECT * FROM where text="rhok"
  16. 16. Inserting dataINSERT INTO bitly.shorten (login, apiKey, longUrl)VALUES (ME, API_KEY,
  17. 17. updating dataUPDATE social.profile.statusSET status="Using YQL UPDATE”WHERE guid="NJFIDHVPVVISDX7UKED2WHU"
  18. 18. Accessing Private Data • OAuth 1.0 for authorizationOAuth is complicated – use one of our SDKs at
  19. 19. Retrieving my profile• SELECT * FROM social.contacts WHERE guid=me
  20. 20. Using the YQL Consolemakes it very easy to use it.
  21. 21. url structure•[params]•[para ms] Params q= [ YQL QUERY ] format = [ XML / JSON ] diagnostics = [ true / false ] debug = [ true / false ] callback = [ function name ]
  22. 22. Let’s See It
  23. 23. Query Samples• SELECT * FROM where q=hackathon’ limit 5• select * from where query="cars" and type="resolved"• select * from google.translate where q="this is a test" and target="hi";• select * from google.translate where q in (select text from where q="hackday") and target=hi;• select * from search.termextract where context in (select description from rss where url=
  24. 24. Query Samples• select * from where symbol in ("YHOO","AAPL","GOOG","MSFT")• insert into yahoo.shortener (url, keysize) values (, 5)• select * from where location="bangalore" and type="apa" and query="indiranagar”• select * from html where url="" and xpath=//div[@id="yfi_headlines"]/div[2]/ul/li/a’
  25. 25. Making Requests: Flickr URLs<photo farm="3" id="5708163920" isfamily="0" isfriend="0" ispublic="1" owner="31832337@N04" secret="0075137487" server="2496" title="San Francisco"/>
  26. 26. Making Requests: Flickr URLsPhoto URLhttp://farm{$farm}{$server}/{$id}_{$secret}.jpgPhoto Page URL{$owner}/{$id}Photo Owner Profile URL{$owner}
  27. 27. YQL is open – you can get your data tables in our system
  28. 28. Craigslist data table<table> <meta> <author>Yahoo! Inc.</author> <documentationURL></documentationURL> <sampleQuery> select * from {table} where location="sfbay" and type="sss" and query=“bike” </sampleQuery> </meta> <bindings> … </bindings></table>
  29. 29. Craigslist data table<table> <meta> … </meta> <bindings> <select itemPath="" produces="XML"> <urls> <url>http://{location}{type}?format=rss</url> </urls> <inputs> <key id="location" type="xs:string" paramType="path" required="true"/> <key id="type" type="xs:string" paramType="path" required="true"/> <key id="query" type="xs:string" paramType="query" required="true"/> </inputs> </select> </bindings></table>
  30. 30. Upload XML to our Github
  31. 31. Or to your own Site• The USE clauseUSE mytable;SELECT * FROM mytableWHERE user=john_doe
  32. 32. You can even write server sidejavascript to build a webservice
  33. 33. Final Lessons• YQL is a skeleton key for all Yahoo! APIs• Open data tables allow you to create new data feeds out of one or many different raw sources• There are 1200+ Tables in YQL covering all major APIs on the web• Use SDKs when accessing private data that requires OAuth
  34. 34. Final Lessons: Links• All Yahoo! APIs and Services•• YQL Documentation•• YQL Console•• YQL Github Account (Contribute Tables)•
  35. 35.
  36. 36. Questions? Jai Santhosh Twitter: @jaisanth Github:
  37. 37. THANK YOU!