yahoo! hack india: hyderabad 2013 | yql - one api to query them all

27

Upload: yahoo-developer-network

Post on 26-Jan-2015

103 views

Category:

Technology


0 download

DESCRIPTION

Sumeet Mulani giving an introduction to YQL

TRANSCRIPT

Page 1: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all
Page 2: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

YQL One API to query them all Sumeet Mulani [Technical Yahoo!] @teemus

Page 3: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

3

#yhackhyderabad2013

Page 4: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

data manipulation hacks = + data visualisation

4

Page 5: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

The internet is data-heavy!

5

<h#ps://www.flickr.com/photos/nadircruise/8593208924/>  

Page 6: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

ProgrammableWeb.com – 9504 APIs

6

Page 7: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

The problems with APIs… •  Discovery (Endpoints,

capabilities, etc.) •  Access (API keys, secrets,

etc.) •  RTFM (A pain when you

are in hack mode!) •  Data massaging

(Conversion, filtering, etc.) •  The more, the merrier,

NOT

7

<h#p://en.wikipedia.org/wiki/File:The_Scream.jpg>  

Page 8: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

YQL #FTW

8

Make data access easy for the web!

Page 9: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

9

YQL turns web services and data on the internet into databases.

SQL-like syntax SELECT {what} FROM {where} WHERE {conditions}

Page 10: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

10

Select Filter Sort Limit Insert Update Delete

<h#ps://www.flickr.com/photos/capcase/4970062156/>  

Page 11: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

11

http://developer.yahoo.com/yql/console

Page 12: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

12

Page 13: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

Finding videos on YouTube…

SELECT * FROM youtube.search WHERE query="russell peters"

13

Page 14: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

14

Stock quotes, anyone?

SELECT * FROM yahoo.finance.quotes WHERE symbol IN ("YHOO", "AAPL", "GOOG", "AMZN”, “FB”);

Page 15: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

15

Search craigslist…

SELECT * FROM craigslist.search WHERE location="sfbay” AND type="sss” AND query="dj mixer"

Page 16: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

16

One-line URL shortener…

INSERT INTO yahoo.y.ahoo.it (url, keysize) VALUES ('http://9to5mac.com/', 5)

Page 17: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

17

Retrieve my Yahoo! contacts

SELECT * FROM social.contacts WHERE guid=me

Page 18: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

Accessing private data •  Use the endpoint

http://query.yahooapis.com/v1/yql •  Requires OAuth for authentication

http://developer.yahoo.com/oauth/guide/index.html

•  Use one of our SDKs –

https://github.com/yahoo

18

Page 19: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

19

1000+ APIs

Page 20: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

How do I get data from YQL into hacks?

20

•  YQL is a REST API in itself and has two endpoints

•  Public endpoint requires no authentication: http://query.yahooapis.com/v1/public/yql?q=query&format=format

•  The private endpoint requires OAuth credentials: http://query.yahooapis.com/v1/yql?q=query&format=format

•  Supported output formats: JSON, XML •  Use your favourite programming language!

Page 21: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

YQL is open!

21

•  You can get your data tables into our system!

•  Just write an XML schema and put it on GitHub - https://github.com/yql/yql-tables

•  Example: craigslist search table - https://github.com/yql/yql-tables/blob/master/craigslist/craigslist.search.xml

Page 22: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

22

Or, host your own table and use ‘USE’!

USE ‘http://www.mysite.com/myTable.xml’ as mytable; SELECT * FROM mytable WHERE key=“value”;

<h#ps://www.flickr.com/photos/weldhouse/3083969633/>  

Page 23: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

23

There are a lot of things you can do with YQL. Your imagination is the limit.

Page 24: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

Amazing YQL-powered hacks •  Webmeme.In – http://www.webmeme.in/

§  Indian news aggregator •  ChromeYQLip – http://y.ahoo.it/bVSq9

§  A Chrome extension for page scraping using YQL §  Open Hack Bangalore 2010 winner

•  FakeSiri – http://y.ahoo.it/3D05u §  Voice assistant for Chrome

24

Page 25: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

25

YQL Console and hack demos

Page 26: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

Wake up. It’s over. (Get coffee. Prepare to hack!) <http://developer.yahoo.com/yql/>

26

Page 27: Yahoo! Hack India: Hyderabad 2013 | YQL - One API to query them all

27

Thank you! @teemus