SlideShare una empresa de Scribd logo
1 de 49
Descargar para leer sin conexión
Design Your API
Learnings From Twitter + Stamen
Basics
We don’t need to define what an API is at this point...
http://twitter.com/users/show/al3x.json




...but it’s worth explaining where APIs have ended up. This is an example from the API I
maintain at Twitter. Can anyone guess what it does?
(It’s basically all about REST)




Most providers have decided on REST. Google abandoned SOAP. XML-RPC is gradually being
abandoned. This makes a conversation about APIs much simpler.
Provider
I’m coming from the perspective of developing, maintaining, and providing an API.
The Twitter API

‣   Comprises most of Twitter’s web traffic.
‣   ~1600 developers in our Google Group.
‣   ~400 applications we credit, tons more out there.
‣   Apps on pretty much every platform.
‣   XML, JSON, RSS, and Atom.
Grow it organically.
Never really promoted the Twitter API. Community has set the direction, helped shape the
API.
Document.


Things really took off when we formally documented the API. Take the time to write
thorough documentation.
Support.




Start a community. Get involved. Listen. Delegate.
Scale.
Think about scale sooner than later: rate limits, extra servers, partitioning.
Secure.




* attributes will leak
* the integration points between you API and the rest of your site will be tested
* little things like crossdomain.xml can have a big impact
What We Did Wrong

‣   Didn’t start with api.twitter.com
‣   Didn’t version the API from the get-go.
‣   Didn’t make life easier for Flash developers.
‣   Didn’t automate to make life easier for us.
‣   Much, much more...
New In The Twitter API

‣   Introductory location support.
‣   More consistency between methods.
‣   More parity between the site and the API.
Business.
The role of APIs in becoming a profitable web business is complicated. For new companies,
it’s essential. For established companies, it’s optional, and so they often get it wrong.
$
                         Money Making?



                          ‣   API as loss-leader.
                          ‣   Mashery?
                          ‣   QoS.




Additional anecdote: Twitteriffic making money of our API even though we don’t.
Future!
What’s next for people providing APIs?
OAuth
Jabber/XMPP
Push?

Something easier than XMPP - HTTP based, like Comet? Gnip.
Web→API→SOA


A solid development model, and the one Twitter is gradually moving towards. Eat your own
dogfood while taking advantage of the separation of concerns that an API inherently gives
you. Flickr interestingness example, Google App Engine and AWS development model.
Loosely Joining
                       Small Pieces
                                Pieces, things, joints:
                               physical metaphors that
                                make everything easy.




We are envisioning a very near future where web services atomize into tiny bricks of context and
functionality, e.g. Dopplr, Fire Eagle, Del.icio.us, Ffffound!, etc. Good API's done right will make this not
feel like the decline and fall of the Roman Empire.
- There's a universe of cool stuff that you can't predict. An open interface signals readiness for
whatever may come.
- Oakland Police Department's CrimeWatch website had no usable data layer, Crimespotting is a
technological guerilla action to create one.
“Get into those individual crimes”
- We're intentionally trying to stretch the definition of quot;APIquot; here: the classic, Flickr-driven concept of
an XML web service is definitely one Web 2.0 compliant way of looking at things, but Excel files and
permanent URLs right there on the website is a broader concept that invites members of the non-geek
public to join in. These have all been API-like quot;handlesquot; that visitors can connect with.
Formats
             XML, spreadsheets compatible with Excel,
             static visual maps suitable for copy-paste,
              plain HTML, e-mail, Atom + GeoRSS, etc.




We borrow what's useful.
Report data last published by Oakland Police: 2 days ago




                                                                                    Home     Map    Crime Reports    Police Beats     Alerts    About     Feedback


Murder
Wednesday, Mar 5, 2008 5:48am

MURDER

Case Number 08-016924-003, Police Beat 06X.

3200 block of San Pablo Ave, Emeryville, CA 94608, USA

Scroll down to see related and nearby reports, or to leave a comment.




View an interactive map of this report.

Related Reports
These reports are directly related to the one above, and may be part of the same incident.

Aggravated Assault                        Murder                               Murder                           Aggravated Assault
6:14am                                    6:14am                               5:48am                           5:48am
Wednesday, Mar 5, 2008                    Wednesday, Mar 5, 2008               Wednesday, Mar 5, 2008           Wednesday, Mar 5, 2008
Static URLs
Things should stay where you left them.
Digg Labs, API
                                        2006 – now




- Stamen co-designed Digg's web services API in support of our Labs work from 2006. We started with
an XML service to support our interactive visualizations, and ended up with a documented, publicly-
supported interface.
Knowns
                   Should Just Work in a browser.
              Key registration is a hassle to be avoided.
              Do all of your dates as Unix timestamps.
              Stick to these core formats: XML, JSON,
                serialized PHP, Javascript callbacks.



- Things we knew going in: most of our decisions were focused on making API use as easy as possible
for data consumers: Just Works in a browser, no API key signup, four different formats (XML, JSON,
javascript with callbacks, serialized PHP), dates are Unix timestamps because every client language
knows how to handle these.
JSON
             Response
             { “stories”: [ {“title”: ... }, ... ] }



             Javascript
             response.stories[0].title





   - JSON responses are built for ease of iteration and descent, e.g.
quot;response.stories[0].user.namequot; and so on.
XML
            Homegrown document type

            <?xml version=”1.0” encoding=”utf-8”?>
            <stories ...>
                <story id=”...”>
                    <title>...</title>
                    <user name=”...”/>
                </story>
                ...
            </stories>




  - XML is a custom syntax, trying to shoehorn the semantics onto Atom and RSS via XML
namespaces leads only to suffering.
REST
“REST” is just web-jargon for
   Moving Things instead
      of Doing Stuff.
URLs
             Requests
             http://services.digg.com
                 /users
                 /users/migurski/friends
                 /stories
                 /stories/upcoming
                 /stories/topic/apple
                 /stories/topic/apple/popular





   - JSON responses are built for ease of iteration and descent, e.g.
quot;response.stories[0].user.namequot; and so on.
News To Us
                   Unit tests are the single best way to
                   coordinate design and development.
                    Expect your database to change.





   - Unit tests were an artifact that we could pass back & forth; Digg would run them and find bugs,
we'd talk about which tests were valid and which were missing, they acted as a transferrable set of
expectations. Python is wonderful for this.


    - New kinds of queries and new data columns had to be introduced to support certain features
that we thought were worthwhile. For example, it's possible to query Digg stories based on domain
name e.g. nytimes.com - why doesn't Del.icio.us do this?
Whoops
                        If you defer a feature at launch,
                      it’ll take forever to prioritize again.




- What we got wrong: don't leave things off at the start, it gives you a license to leave them off forever.
Digg still lacks a writeable API, it's not anybody's fault it's just an easy thing to defer. The world is
missing out on a vast array of potential services that Digg users could be building with such a thing.
Coming Up
Amazon S3
              A sign of things to come: authentication,
             utility interface, do one thing and do it best.




- More than just data, e.g. Amazon's S3, SQS, etc. - Amazon is building up a stack of services that form
the building blocks of distributed computing application and the billing infrastructure that supports
them. Amazon's doing some interesting stuff with request authentication and pre-signing.
OAuth
                             Delegated authentication
                               is the missing piece




- Small pieces loosely joined by OAuth. There's an OAuth session competing with this one right now,
but we think that a vetted standard for 3rd party authentication will help web services make good on
their promise by distinguishing between the consumer and the authenticated user, i.e. doing stuff on
someone's behalf without invoking the password anti-pattern.
¡Thank You!
                                          ¿Questions?




- There's a universe of cool stuff that you can't predict. An open interface signals readiness for
whatever may come.
Photo Credits

http://www.flickr.com/photos/jurvetson/215722930/

http://www.flickr.com/photos/mwichary/2322639175/

http://www.flickr.com/photos/iamagenious/372349393/

http://www.flickr.com/photos/whiskeytango/1431343034/

http://www.flickr.com/photos/carbonnyc/2294144289/

Más contenido relacionado

Más de jward5519

Mashing Up Taking Enterprise Mashups To The Next Level Presentation
Mashing Up  Taking Enterprise Mashups To The Next Level  PresentationMashing Up  Taking Enterprise Mashups To The Next Level  Presentation
Mashing Up Taking Enterprise Mashups To The Next Level Presentationjward5519
 
Ibm Web 2 0 Goes To Work Presentation
Ibm  Web 2 0 Goes To Work PresentationIbm  Web 2 0 Goes To Work Presentation
Ibm Web 2 0 Goes To Work Presentationjward5519
 
Global Design Trends Presentation
Global Design Trends PresentationGlobal Design Trends Presentation
Global Design Trends Presentationjward5519
 
Maximizing Conversions And Overall Campaign Roi Presentation
Maximizing Conversions And Overall Campaign Roi PresentationMaximizing Conversions And Overall Campaign Roi Presentation
Maximizing Conversions And Overall Campaign Roi Presentationjward5519
 
Maximizing Ad Revenue Through Format Optimization Presentation
Maximizing Ad Revenue Through Format Optimization PresentationMaximizing Ad Revenue Through Format Optimization Presentation
Maximizing Ad Revenue Through Format Optimization Presentationjward5519
 
Free Traffic Seo Smo 101 (Search Engine Social Media Optimization) Present...
Free Traffic  Seo Smo 101 (Search Engine   Social Media Optimization) Present...Free Traffic  Seo Smo 101 (Search Engine   Social Media Optimization) Present...
Free Traffic Seo Smo 101 (Search Engine Social Media Optimization) Present...jward5519
 
Free Traffic Seo Smo 101 (Search Engine Social Media Optimization) Present...
Free Traffic  Seo Smo 101 (Search Engine   Social Media Optimization) Present...Free Traffic  Seo Smo 101 (Search Engine   Social Media Optimization) Present...
Free Traffic Seo Smo 101 (Search Engine Social Media Optimization) Present...jward5519
 
Do Try This At Home Ajax Bookmarking, Cross Site Scripting, And Other Web 2 ...
Do Try This At Home  Ajax Bookmarking, Cross Site Scripting, And Other Web 2 ...Do Try This At Home  Ajax Bookmarking, Cross Site Scripting, And Other Web 2 ...
Do Try This At Home Ajax Bookmarking, Cross Site Scripting, And Other Web 2 ...jward5519
 
Data Portability, Privacy, And The Emergence Of The Social Web Presentation
Data Portability, Privacy, And The Emergence Of The Social Web PresentationData Portability, Privacy, And The Emergence Of The Social Web Presentation
Data Portability, Privacy, And The Emergence Of The Social Web Presentationjward5519
 
Design Learnings From Viral Applications Presentation
Design Learnings From Viral Applications PresentationDesign Learnings From Viral Applications Presentation
Design Learnings From Viral Applications Presentationjward5519
 
Developing, Distributing, And Monetizing Web Applications With Web Ex Connect...
Developing, Distributing, And Monetizing Web Applications With Web Ex Connect...Developing, Distributing, And Monetizing Web Applications With Web Ex Connect...
Developing, Distributing, And Monetizing Web Applications With Web Ex Connect...jward5519
 
Design Learnings From Viral Applications Presentation
Design Learnings From Viral Applications PresentationDesign Learnings From Viral Applications Presentation
Design Learnings From Viral Applications Presentationjward5519
 
Capacity Planning For Web Operations Presentation
Capacity Planning For Web Operations PresentationCapacity Planning For Web Operations Presentation
Capacity Planning For Web Operations Presentationjward5519
 
Creating Semantic Mashups Bridging Web 2 0 And The Semantic Web Presentation 1
Creating Semantic Mashups  Bridging Web 2 0 And The Semantic Web Presentation 1Creating Semantic Mashups  Bridging Web 2 0 And The Semantic Web Presentation 1
Creating Semantic Mashups Bridging Web 2 0 And The Semantic Web Presentation 1jward5519
 
Creating Semantic Mashups Bridging Web 2 0 And The Semantic Web Presentation 1
Creating Semantic Mashups  Bridging Web 2 0 And The Semantic Web Presentation 1Creating Semantic Mashups  Bridging Web 2 0 And The Semantic Web Presentation 1
Creating Semantic Mashups Bridging Web 2 0 And The Semantic Web Presentation 1jward5519
 
Data Portability, Privacy, And The Emergence Of The Social Web Presentation
Data Portability, Privacy, And The Emergence Of The Social Web PresentationData Portability, Privacy, And The Emergence Of The Social Web Presentation
Data Portability, Privacy, And The Emergence Of The Social Web Presentationjward5519
 
Capacity Planning For Web Operations Presentation
Capacity Planning For Web Operations PresentationCapacity Planning For Web Operations Presentation
Capacity Planning For Web Operations Presentationjward5519
 
Building An App For Social Platforms Presentation
Building An App For Social Platforms PresentationBuilding An App For Social Platforms Presentation
Building An App For Social Platforms Presentationjward5519
 
A Symfony Answer Presentation
A Symfony Answer PresentationA Symfony Answer Presentation
A Symfony Answer Presentationjward5519
 
Tools For Managing Creative Environment Presentation
Tools For Managing Creative Environment PresentationTools For Managing Creative Environment Presentation
Tools For Managing Creative Environment Presentationjward5519
 

Más de jward5519 (20)

Mashing Up Taking Enterprise Mashups To The Next Level Presentation
Mashing Up  Taking Enterprise Mashups To The Next Level  PresentationMashing Up  Taking Enterprise Mashups To The Next Level  Presentation
Mashing Up Taking Enterprise Mashups To The Next Level Presentation
 
Ibm Web 2 0 Goes To Work Presentation
Ibm  Web 2 0 Goes To Work PresentationIbm  Web 2 0 Goes To Work Presentation
Ibm Web 2 0 Goes To Work Presentation
 
Global Design Trends Presentation
Global Design Trends PresentationGlobal Design Trends Presentation
Global Design Trends Presentation
 
Maximizing Conversions And Overall Campaign Roi Presentation
Maximizing Conversions And Overall Campaign Roi PresentationMaximizing Conversions And Overall Campaign Roi Presentation
Maximizing Conversions And Overall Campaign Roi Presentation
 
Maximizing Ad Revenue Through Format Optimization Presentation
Maximizing Ad Revenue Through Format Optimization PresentationMaximizing Ad Revenue Through Format Optimization Presentation
Maximizing Ad Revenue Through Format Optimization Presentation
 
Free Traffic Seo Smo 101 (Search Engine Social Media Optimization) Present...
Free Traffic  Seo Smo 101 (Search Engine   Social Media Optimization) Present...Free Traffic  Seo Smo 101 (Search Engine   Social Media Optimization) Present...
Free Traffic Seo Smo 101 (Search Engine Social Media Optimization) Present...
 
Free Traffic Seo Smo 101 (Search Engine Social Media Optimization) Present...
Free Traffic  Seo Smo 101 (Search Engine   Social Media Optimization) Present...Free Traffic  Seo Smo 101 (Search Engine   Social Media Optimization) Present...
Free Traffic Seo Smo 101 (Search Engine Social Media Optimization) Present...
 
Do Try This At Home Ajax Bookmarking, Cross Site Scripting, And Other Web 2 ...
Do Try This At Home  Ajax Bookmarking, Cross Site Scripting, And Other Web 2 ...Do Try This At Home  Ajax Bookmarking, Cross Site Scripting, And Other Web 2 ...
Do Try This At Home Ajax Bookmarking, Cross Site Scripting, And Other Web 2 ...
 
Data Portability, Privacy, And The Emergence Of The Social Web Presentation
Data Portability, Privacy, And The Emergence Of The Social Web PresentationData Portability, Privacy, And The Emergence Of The Social Web Presentation
Data Portability, Privacy, And The Emergence Of The Social Web Presentation
 
Design Learnings From Viral Applications Presentation
Design Learnings From Viral Applications PresentationDesign Learnings From Viral Applications Presentation
Design Learnings From Viral Applications Presentation
 
Developing, Distributing, And Monetizing Web Applications With Web Ex Connect...
Developing, Distributing, And Monetizing Web Applications With Web Ex Connect...Developing, Distributing, And Monetizing Web Applications With Web Ex Connect...
Developing, Distributing, And Monetizing Web Applications With Web Ex Connect...
 
Design Learnings From Viral Applications Presentation
Design Learnings From Viral Applications PresentationDesign Learnings From Viral Applications Presentation
Design Learnings From Viral Applications Presentation
 
Capacity Planning For Web Operations Presentation
Capacity Planning For Web Operations PresentationCapacity Planning For Web Operations Presentation
Capacity Planning For Web Operations Presentation
 
Creating Semantic Mashups Bridging Web 2 0 And The Semantic Web Presentation 1
Creating Semantic Mashups  Bridging Web 2 0 And The Semantic Web Presentation 1Creating Semantic Mashups  Bridging Web 2 0 And The Semantic Web Presentation 1
Creating Semantic Mashups Bridging Web 2 0 And The Semantic Web Presentation 1
 
Creating Semantic Mashups Bridging Web 2 0 And The Semantic Web Presentation 1
Creating Semantic Mashups  Bridging Web 2 0 And The Semantic Web Presentation 1Creating Semantic Mashups  Bridging Web 2 0 And The Semantic Web Presentation 1
Creating Semantic Mashups Bridging Web 2 0 And The Semantic Web Presentation 1
 
Data Portability, Privacy, And The Emergence Of The Social Web Presentation
Data Portability, Privacy, And The Emergence Of The Social Web PresentationData Portability, Privacy, And The Emergence Of The Social Web Presentation
Data Portability, Privacy, And The Emergence Of The Social Web Presentation
 
Capacity Planning For Web Operations Presentation
Capacity Planning For Web Operations PresentationCapacity Planning For Web Operations Presentation
Capacity Planning For Web Operations Presentation
 
Building An App For Social Platforms Presentation
Building An App For Social Platforms PresentationBuilding An App For Social Platforms Presentation
Building An App For Social Platforms Presentation
 
A Symfony Answer Presentation
A Symfony Answer PresentationA Symfony Answer Presentation
A Symfony Answer Presentation
 
Tools For Managing Creative Environment Presentation
Tools For Managing Creative Environment PresentationTools For Managing Creative Environment Presentation
Tools For Managing Creative Environment Presentation
 

Último

Stock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdfStock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdfMichael Silva
 
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...First NO1 World Amil baba in Faisalabad
 
Stock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdfStock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdfMichael Silva
 
House of Commons ; CDC schemes overview document
House of Commons ; CDC schemes overview documentHouse of Commons ; CDC schemes overview document
House of Commons ; CDC schemes overview documentHenry Tapper
 
Current Economic situation of Pakistan .pptx
Current Economic situation of Pakistan .pptxCurrent Economic situation of Pakistan .pptx
Current Economic situation of Pakistan .pptxuzma244191
 
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办fqiuho152
 
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...Amil Baba Dawood bangali
 
government_intervention_in_business_ownership[1].pdf
government_intervention_in_business_ownership[1].pdfgovernment_intervention_in_business_ownership[1].pdf
government_intervention_in_business_ownership[1].pdfshaunmashale756
 
Call Girls In Yusuf Sarai Women Seeking Men 9654467111
Call Girls In Yusuf Sarai Women Seeking Men 9654467111Call Girls In Yusuf Sarai Women Seeking Men 9654467111
Call Girls In Yusuf Sarai Women Seeking Men 9654467111Sapana Sha
 
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...Amil Baba Dawood bangali
 
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...Henry Tapper
 
Stock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdfStock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdfMichael Silva
 
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...yordanosyohannes2
 
SBP-Market-Operations and market managment
SBP-Market-Operations and market managmentSBP-Market-Operations and market managment
SBP-Market-Operations and market managmentfactical
 
212MTAMount Durham University Bachelor's Diploma in Technology
212MTAMount Durham University Bachelor's Diploma in Technology212MTAMount Durham University Bachelor's Diploma in Technology
212MTAMount Durham University Bachelor's Diploma in Technologyz xss
 
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》rnrncn29
 
Tenets of Physiocracy History of Economic
Tenets of Physiocracy History of EconomicTenets of Physiocracy History of Economic
Tenets of Physiocracy History of Economiccinemoviesu
 
Call Girls Near Delhi Pride Hotel, New Delhi|9873777170
Call Girls Near Delhi Pride Hotel, New Delhi|9873777170Call Girls Near Delhi Pride Hotel, New Delhi|9873777170
Call Girls Near Delhi Pride Hotel, New Delhi|9873777170Sonam Pathan
 
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Último (20)

Stock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdfStock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdf
 
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
Authentic No 1 Amil Baba In Pakistan Authentic No 1 Amil Baba In Karachi No 1...
 
Stock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdfStock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdf
 
House of Commons ; CDC schemes overview document
House of Commons ; CDC schemes overview documentHouse of Commons ; CDC schemes overview document
House of Commons ; CDC schemes overview document
 
Current Economic situation of Pakistan .pptx
Current Economic situation of Pakistan .pptxCurrent Economic situation of Pakistan .pptx
Current Economic situation of Pakistan .pptx
 
🔝+919953056974 🔝young Delhi Escort service Pusa Road
🔝+919953056974 🔝young Delhi Escort service Pusa Road🔝+919953056974 🔝young Delhi Escort service Pusa Road
🔝+919953056974 🔝young Delhi Escort service Pusa Road
 
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办
(办理原版一样)QUT毕业证昆士兰科技大学毕业证学位证留信学历认证成绩单补办
 
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...
NO1 WorldWide online istikhara for love marriage vashikaran specialist love p...
 
government_intervention_in_business_ownership[1].pdf
government_intervention_in_business_ownership[1].pdfgovernment_intervention_in_business_ownership[1].pdf
government_intervention_in_business_ownership[1].pdf
 
Call Girls In Yusuf Sarai Women Seeking Men 9654467111
Call Girls In Yusuf Sarai Women Seeking Men 9654467111Call Girls In Yusuf Sarai Women Seeking Men 9654467111
Call Girls In Yusuf Sarai Women Seeking Men 9654467111
 
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...
NO1 Certified Ilam kala Jadu Specialist Expert In Bahawalpur, Sargodha, Sialk...
 
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...
letter-from-the-chair-to-the-fca-relating-to-british-steel-pensions-scheme-15...
 
Stock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdfStock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdf
 
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
AfRESFullPaper22018EmpiricalPerformanceofRealEstateInvestmentTrustsandShareho...
 
SBP-Market-Operations and market managment
SBP-Market-Operations and market managmentSBP-Market-Operations and market managment
SBP-Market-Operations and market managment
 
212MTAMount Durham University Bachelor's Diploma in Technology
212MTAMount Durham University Bachelor's Diploma in Technology212MTAMount Durham University Bachelor's Diploma in Technology
212MTAMount Durham University Bachelor's Diploma in Technology
 
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
《加拿大本地办假证-寻找办理Dalhousie毕业证和达尔豪斯大学毕业证书的中介代理》
 
Tenets of Physiocracy History of Economic
Tenets of Physiocracy History of EconomicTenets of Physiocracy History of Economic
Tenets of Physiocracy History of Economic
 
Call Girls Near Delhi Pride Hotel, New Delhi|9873777170
Call Girls Near Delhi Pride Hotel, New Delhi|9873777170Call Girls Near Delhi Pride Hotel, New Delhi|9873777170
Call Girls Near Delhi Pride Hotel, New Delhi|9873777170
 
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 

Design Your Api Learnings From Twitter And Stamen Presentation

  • 1. Design Your API Learnings From Twitter + Stamen
  • 2. Basics We don’t need to define what an API is at this point...
  • 3. http://twitter.com/users/show/al3x.json ...but it’s worth explaining where APIs have ended up. This is an example from the API I maintain at Twitter. Can anyone guess what it does?
  • 4. (It’s basically all about REST) Most providers have decided on REST. Google abandoned SOAP. XML-RPC is gradually being abandoned. This makes a conversation about APIs much simpler.
  • 5. Provider I’m coming from the perspective of developing, maintaining, and providing an API.
  • 6. The Twitter API ‣ Comprises most of Twitter’s web traffic. ‣ ~1600 developers in our Google Group. ‣ ~400 applications we credit, tons more out there. ‣ Apps on pretty much every platform. ‣ XML, JSON, RSS, and Atom.
  • 7. Grow it organically. Never really promoted the Twitter API. Community has set the direction, helped shape the API.
  • 8. Document. Things really took off when we formally documented the API. Take the time to write thorough documentation.
  • 9. Support. Start a community. Get involved. Listen. Delegate.
  • 10. Scale. Think about scale sooner than later: rate limits, extra servers, partitioning.
  • 11. Secure. * attributes will leak * the integration points between you API and the rest of your site will be tested * little things like crossdomain.xml can have a big impact
  • 12. What We Did Wrong ‣ Didn’t start with api.twitter.com ‣ Didn’t version the API from the get-go. ‣ Didn’t make life easier for Flash developers. ‣ Didn’t automate to make life easier for us. ‣ Much, much more...
  • 13. New In The Twitter API ‣ Introductory location support. ‣ More consistency between methods. ‣ More parity between the site and the API.
  • 14. Business. The role of APIs in becoming a profitable web business is complicated. For new companies, it’s essential. For established companies, it’s optional, and so they often get it wrong.
  • 15. $ Money Making? ‣ API as loss-leader. ‣ Mashery? ‣ QoS. Additional anecdote: Twitteriffic making money of our API even though we don’t.
  • 16. Future! What’s next for people providing APIs?
  • 17. OAuth
  • 19. Push? Something easier than XMPP - HTTP based, like Comet? Gnip.
  • 20. Web→API→SOA A solid development model, and the one Twitter is gradually moving towards. Eat your own dogfood while taking advantage of the separation of concerns that an API inherently gives you. Flickr interestingness example, Google App Engine and AWS development model.
  • 21. Loosely Joining Small Pieces Pieces, things, joints: physical metaphors that make everything easy. We are envisioning a very near future where web services atomize into tiny bricks of context and functionality, e.g. Dopplr, Fire Eagle, Del.icio.us, Ffffound!, etc. Good API's done right will make this not feel like the decline and fall of the Roman Empire. - There's a universe of cool stuff that you can't predict. An open interface signals readiness for whatever may come.
  • 22.
  • 23. - Oakland Police Department's CrimeWatch website had no usable data layer, Crimespotting is a technological guerilla action to create one.
  • 24. “Get into those individual crimes”
  • 25.
  • 26. - We're intentionally trying to stretch the definition of quot;APIquot; here: the classic, Flickr-driven concept of an XML web service is definitely one Web 2.0 compliant way of looking at things, but Excel files and permanent URLs right there on the website is a broader concept that invites members of the non-geek public to join in. These have all been API-like quot;handlesquot; that visitors can connect with.
  • 27. Formats XML, spreadsheets compatible with Excel, static visual maps suitable for copy-paste, plain HTML, e-mail, Atom + GeoRSS, etc. We borrow what's useful.
  • 28.
  • 29. Report data last published by Oakland Police: 2 days ago Home Map Crime Reports Police Beats Alerts About Feedback Murder Wednesday, Mar 5, 2008 5:48am MURDER Case Number 08-016924-003, Police Beat 06X. 3200 block of San Pablo Ave, Emeryville, CA 94608, USA Scroll down to see related and nearby reports, or to leave a comment. View an interactive map of this report. Related Reports These reports are directly related to the one above, and may be part of the same incident. Aggravated Assault Murder Murder Aggravated Assault 6:14am 6:14am 5:48am 5:48am Wednesday, Mar 5, 2008 Wednesday, Mar 5, 2008 Wednesday, Mar 5, 2008 Wednesday, Mar 5, 2008
  • 30.
  • 31. Static URLs Things should stay where you left them.
  • 32. Digg Labs, API 2006 – now - Stamen co-designed Digg's web services API in support of our Labs work from 2006. We started with an XML service to support our interactive visualizations, and ended up with a documented, publicly- supported interface.
  • 33.
  • 34.
  • 35.
  • 36. Knowns Should Just Work in a browser. Key registration is a hassle to be avoided. Do all of your dates as Unix timestamps. Stick to these core formats: XML, JSON, serialized PHP, Javascript callbacks. - Things we knew going in: most of our decisions were focused on making API use as easy as possible for data consumers: Just Works in a browser, no API key signup, four different formats (XML, JSON, javascript with callbacks, serialized PHP), dates are Unix timestamps because every client language knows how to handle these.
  • 37. JSON Response { “stories”: [ {“title”: ... }, ... ] } Javascript response.stories[0].title - JSON responses are built for ease of iteration and descent, e.g. quot;response.stories[0].user.namequot; and so on.
  • 38. XML Homegrown document type <?xml version=”1.0” encoding=”utf-8”?> <stories ...> <story id=”...”> <title>...</title> <user name=”...”/> </story> ... </stories> - XML is a custom syntax, trying to shoehorn the semantics onto Atom and RSS via XML namespaces leads only to suffering.
  • 39. REST “REST” is just web-jargon for Moving Things instead of Doing Stuff.
  • 40.
  • 41.
  • 42. URLs Requests http://services.digg.com /users /users/migurski/friends /stories /stories/upcoming /stories/topic/apple /stories/topic/apple/popular - JSON responses are built for ease of iteration and descent, e.g. quot;response.stories[0].user.namequot; and so on.
  • 43. News To Us Unit tests are the single best way to coordinate design and development. Expect your database to change. - Unit tests were an artifact that we could pass back & forth; Digg would run them and find bugs, we'd talk about which tests were valid and which were missing, they acted as a transferrable set of expectations. Python is wonderful for this. - New kinds of queries and new data columns had to be introduced to support certain features that we thought were worthwhile. For example, it's possible to query Digg stories based on domain name e.g. nytimes.com - why doesn't Del.icio.us do this?
  • 44. Whoops If you defer a feature at launch, it’ll take forever to prioritize again. - What we got wrong: don't leave things off at the start, it gives you a license to leave them off forever. Digg still lacks a writeable API, it's not anybody's fault it's just an easy thing to defer. The world is missing out on a vast array of potential services that Digg users could be building with such a thing.
  • 46. Amazon S3 A sign of things to come: authentication, utility interface, do one thing and do it best. - More than just data, e.g. Amazon's S3, SQS, etc. - Amazon is building up a stack of services that form the building blocks of distributed computing application and the billing infrastructure that supports them. Amazon's doing some interesting stuff with request authentication and pre-signing.
  • 47. OAuth Delegated authentication is the missing piece - Small pieces loosely joined by OAuth. There's an OAuth session competing with this one right now, but we think that a vetted standard for 3rd party authentication will help web services make good on their promise by distinguishing between the consumer and the authenticated user, i.e. doing stuff on someone's behalf without invoking the password anti-pattern.
  • 48. ¡Thank You! ¿Questions? - There's a universe of cool stuff that you can't predict. An open interface signals readiness for whatever may come.