api’s. they’re snazzy.. api’s are nifty. human/computer: gui as computer/more complex...

16
API’s. They’re snazzy.

Upload: emmeline-dennis

Post on 31-Dec-2015

227 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API

API’s. They’re snazzy.

Page 2: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API

API’s are nifty.

Human/Computer: GUIAS

Computer/More complex Computer: API

Page 3: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API

How it works!

API Awesomeness

XML, JSON, Whatever

URL1’s and 0’s

1’s and 0’s

Page 4: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API

Anatomy of an API call

The Base URL The Query The Key

http://BASEURL?query=QUERY&api-key=KEY

Page 5: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API

If you want to try it out (reference):http://code.google.com/apis/chart/image/

https://chart.googleapis.com/chart? cht=<chart_type> &chd=<chart_data> &chs=<chart_size> &...additional_parameters...

https://chart.googleapis.com/chart? cht=p3& chs=250x100& chd=t:60,40& chl=Hello|World

Page 6: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API

Rainfall data• Monday: 8• Tuesday: 50• Weds: 33• Thursday: 55

reference: http://code.google.com/apis/chart/image/

Page 7: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API

Rainfall data• Monday: 8• Tuesday: 50• Weds: 33• Thursday: 55

https://chart.googleapis.com/chart? cht=lc &chs=200x125 &chd=t:8,50,33,55

Page 8: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API

https://code.google.com/apis/ajax/playground/

Page 9: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API

Get to know your Times API’s• Article Search API • Most Popular API• Movie Reviews API• Times Newswire API• TimesPeople API• TimesTags API• Real Estate listings API• Community API• Best Sellers API • Campaign Finance API• Congress API• Districts API• NY State Legislature API

Internal NYTimes Data

External data they’re hosting

for fun

Page 10: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API
Page 11: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API
Page 12: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API

More about queries!• Search terms

q=puppies

Begin date and end dateq=puppies&begin_date=20110828

• Fields requested backq=puppies&fl=headline,date

• Rank (the order)q=puppies&sort=oldest

• page(what group of 10 we’re on)q=puppies&page = 3

page

Page 13: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API

http://developers.nytimes.com/

Cheat sheet!!!11!http://www.upables.org/APIClass/cheatsheet.html

Page 14: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API

Common returned Query items (fl =…)•web_url•Snippet•lead_paragraph•Abstract•print_page•Blog•Source•multimedia

Let’s give it a go!developer.nytimes.com/docs/read/article_search_api_v2

• Headline• Keywords• pub_date• document_type• news_desk• Byline• type_of_material• _id• word_count

Page 15: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API

{"response": {"meta":{"hits":24226,"time":303,"offset":0}, "docs":[

{"headline":{"seo":"A Chicken Thighs Recipe With Mediterranean Flavor","main":"A Chicken’s Tour of the Mediterranean","content_kicker":"City Kitchen","print_headline":"A Chicken’s Tour of the Mediterranean"}"byline":{"person":[{"organization":"","role":"reported","firstname":"David","rank":1,"lastname":"TANIS"}],"original":"By DAVID TANIS"}},

{"headline":{"seo":"Hamptons Chickens Get a Modern Coop by ARO Architects","main":"The Eggs Are Happy, Too ","content_kicker":"Q&A","kicker":"Q&A","print_headline":"The Eggs Are Happy, Too"},

"byline":{"person":[{"organization":"","role":"reported","firstname":"Steven","rank":1,"lastname":"KURUTZ"}],"original":"By STEVEN KURUTZ"}},

]},"status":"OK","copyright":"Copyright (c) 2013 The New York Times Company. All Rights Reserved."}

Page 16: API’s. They’re snazzy.. API’s are nifty. Human/Computer: GUI AS Computer/More complex Computer: API

www.programmableweb.com