SlideShare a Scribd company logo
API Best Practices
         @urilavi
    http://bit.ly/scisr
Public API/ Web API


 HTTP / HTTPS
 XML/JSON
Rule #0




   http://www.flickr.com/photos/holeymoon/2131118247/
Rule #1 - Funnel

          Try

          Build

         Adopt
Simplicity?
TDD public API
At least 3 clients
   Different languages




                     http://www.flickr.com/photos/giosp/3933753363/
Cross Cutting Concerns
 Authentication/Authorization
 Versioning
 Sync/Async
 Re-entrance
 Pagination
 Caching
 Throttling
RESTfulness              * Use plural names (reads
                         better with GET)

                         * Avoid methods (it isn’t
                         traversal and grows
                         fast)




Nouns (Method-less)
  2 base URLS per resource
       /events
       /events/10
RESTfulness
HTTP Verbs on collections/elements
  Create
      POST /events
  Fetch
      GET /events/12345
  Update
      PUT /events/12345
Method-based
               * Use verbs
               * Make the
               documentation clear
               that these are “non
               resource” operations




Convert
Translate
Rule #2 - Relationships
Rule #2 - Relationships


 Keep it simple - 3 levels
Rule #2 - Relationships


 Keep it simple - 3 levels

    GET /lecturers/events/10
Rule #3 - Complexity?




  http://www.flickr.com/photos/takomabibelot/4373062612/
Rule #4 - Versioning
                        * Maintain at least one
                        version back




 GET api/v1/events/10
Rule #4 - Versioning
                        * Maintain at least one
                        version back




 GET api/v1/events/10
Rule #5 - Errors

 HTTP status codes
    {200, 400, 500}
 Verbose messages
   link to documentation
Rule #6 - Sync / Async

 Result available - sync
 Result available in x time - async



                     PicScout’s API
Rule #7- Re-entrance




        http://www.flickr.com/photos/leovan/2152274834/


 POST /funds/accounts/1000/
 {‘value’: 100, ‘token’: ‘xbds213’}
Rule #8 - Formatting



 JaaD = JSON as a Default
Rule #9 - Automation?




        http://www.flickr.com/photos/r80o/39304743/


 APIs are for humans

More Related Content

PPTX
Web Performance 101
Uri Lavi
 
PDF
Speed Index, explained!
Stefan Baumgartner
 
PPTX
Building High Performance Websites - Session-1
Usama Nada
 
PPTX
How fast are we going now?
Steve Souders
 
PDF
Grokking REST (ZendCon 2010)
Ben Ramsey
 
KEY
Speed is Essential for a Great Web Experience
Andy Davies
 
PPTX
Web performance optimization for modern web applications
Chris Love
 
PPTX
do u webview?
Steve Souders
 
Web Performance 101
Uri Lavi
 
Speed Index, explained!
Stefan Baumgartner
 
Building High Performance Websites - Session-1
Usama Nada
 
How fast are we going now?
Steve Souders
 
Grokking REST (ZendCon 2010)
Ben Ramsey
 
Speed is Essential for a Great Web Experience
Andy Davies
 
Web performance optimization for modern web applications
Chris Love
 
do u webview?
Steve Souders
 

What's hot (20)

KEY
Sniffing the Mobile Context
Andy Davies
 
PDF
Progressive Enhancement 2.0 (Conference Agnostic)
Nicholas Zakas
 
PPTX
Browser Wars Episode 1: The Phantom Menace
Nicholas Zakas
 
PDF
State of jQuery '09
jeresig
 
PPTX
High Performance Websites
Parham
 
PDF
Making the web faster
Patrick Meenan
 
PDF
Speed is Essential for a Great Web Experience (Canvas Conf Version)
Andy Davies
 
PDF
[jqconatx] Adaptive Images for Responsive Web Design
Christopher Schmitt
 
PDF
PC Monitoring Software
Aaron Davis
 
PDF
Keep the Web Fast
Chris Fetherston
 
PPTX
5 single page application principles developers need to know
Chris Love
 
PDF
SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...
Distilled
 
PDF
17 Web Performance Metrics You Should Care About
Evgeny Tsarkov
 
PDF
How I learned to stop worrying and love the .htaccess file
Roxana Stingu
 
PPTX
Word campktm speed-security
Digamber Pradhan
 
PDF
The Case for HTTP/2 - Internetdagarna 2015 - Stockholm
Andy Davies
 
PPT
Fast and Easy Website Tuneups
Jeff Wisniewski
 
PPTX
Web Performance Optimization
Patrick Meenan
 
PPTX
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
Bastian Grimm
 
PPTX
A faster journey with HTTP
Michael Ewins
 
Sniffing the Mobile Context
Andy Davies
 
Progressive Enhancement 2.0 (Conference Agnostic)
Nicholas Zakas
 
Browser Wars Episode 1: The Phantom Menace
Nicholas Zakas
 
State of jQuery '09
jeresig
 
High Performance Websites
Parham
 
Making the web faster
Patrick Meenan
 
Speed is Essential for a Great Web Experience (Canvas Conf Version)
Andy Davies
 
[jqconatx] Adaptive Images for Responsive Web Design
Christopher Schmitt
 
PC Monitoring Software
Aaron Davis
 
Keep the Web Fast
Chris Fetherston
 
5 single page application principles developers need to know
Chris Love
 
SearchLove San Diego 2018 | Tom Anthony | An Introduction to HTTP/2 & Service...
Distilled
 
17 Web Performance Metrics You Should Care About
Evgeny Tsarkov
 
How I learned to stop worrying and love the .htaccess file
Roxana Stingu
 
Word campktm speed-security
Digamber Pradhan
 
The Case for HTTP/2 - Internetdagarna 2015 - Stockholm
Andy Davies
 
Fast and Easy Website Tuneups
Jeff Wisniewski
 
Web Performance Optimization
Patrick Meenan
 
10 Tips to make your Website lightning-fast - SMX Stockholm 2012
Bastian Grimm
 
A faster journey with HTTP
Michael Ewins
 
Ad

Viewers also liked (13)

PDF
510G CV 150315 Shane Harris - General R6
Shane Harris
 
PDF
Why don't we have REAL IP to the Edge in Buildings?
Memoori
 
PPTX
EL FUTURO DEL AGUA: TRATAMIENTO Y REUTILIZACIÓN.
Alba Santos Ortega
 
PDF
Institutional Change and Parental Compensation in Intergenerational attainment
TITA research
 
PPTX
Презентация 1.20 - Радиофикация
Илья Конышев
 
PPT
Presentacion del sector
mayraMeneses-23
 
PDF
Pri pro presentasion
yoprst
 
PPTX
My Presentation
Laura Barker
 
PPTX
Twitter for Researchers
University of York Library
 
PPTX
Hcv - immune evasion mechanisms
Marina Ibrahim
 
PPT
Seres autenticos
amstramgramduval
 
PPTX
IoT DDoS Attacks: the stakes have changed
Great Bay Software
 
PPTX
Unit 2 Rules
Grace Ng
 
510G CV 150315 Shane Harris - General R6
Shane Harris
 
Why don't we have REAL IP to the Edge in Buildings?
Memoori
 
EL FUTURO DEL AGUA: TRATAMIENTO Y REUTILIZACIÓN.
Alba Santos Ortega
 
Institutional Change and Parental Compensation in Intergenerational attainment
TITA research
 
Презентация 1.20 - Радиофикация
Илья Конышев
 
Presentacion del sector
mayraMeneses-23
 
Pri pro presentasion
yoprst
 
My Presentation
Laura Barker
 
Twitter for Researchers
University of York Library
 
Hcv - immune evasion mechanisms
Marina Ibrahim
 
Seres autenticos
amstramgramduval
 
IoT DDoS Attacks: the stakes have changed
Great Bay Software
 
Unit 2 Rules
Grace Ng
 
Ad

Similar to API Best Practices (20)

PDF
Creating Great REST and gRPC API Experiences (in Swift)
Tim Burks
 
PDF
Talking to Web Services
DrupalcampAtlanta2012
 
PDF
High Availability by Design
David Prinzing
 
PDF
URL Design
Walter Ebert
 
PPTX
ASP.NET WEB API Training
Chalermpon Areepong
 
PDF
distributing over the web
Nicola Baldi
 
PPTX
Construindo APIs Usando Rails
Fernando Kakimoto
 
PPT
Rapid java backend and api development for mobile devices
ciklum_ods
 
PPTX
Performance #4 network
Vitali Pekelis
 
PDF
Ruby HTTP clients comparison
Hiroshi Nakamura
 
PDF
Rest with Spring
Eugen Paraschiv
 
PPTX
Automate That! Scripting Atlassian applications in Python
Atlassian
 
PPTX
Automate that
Atlassian
 
PPT
REST Web Sebvice
khmerforge
 
PPTX
API Design- Best Practices
Prakash Bhandari
 
PDF
Rest web services
Paulo Gandra de Sousa
 
PDF
Android App Development 06 : Network & Web Services
Anuchit Chalothorn
 
PPTX
Consuming GRIN GLOBAL Webservices
Edwin Rojas
 
PPT
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
Matt O'Keefe
 
PPTX
Service approach for development Rest API in Symfony2
Sumy PHP User Grpoup
 
Creating Great REST and gRPC API Experiences (in Swift)
Tim Burks
 
Talking to Web Services
DrupalcampAtlanta2012
 
High Availability by Design
David Prinzing
 
URL Design
Walter Ebert
 
ASP.NET WEB API Training
Chalermpon Areepong
 
distributing over the web
Nicola Baldi
 
Construindo APIs Usando Rails
Fernando Kakimoto
 
Rapid java backend and api development for mobile devices
ciklum_ods
 
Performance #4 network
Vitali Pekelis
 
Ruby HTTP clients comparison
Hiroshi Nakamura
 
Rest with Spring
Eugen Paraschiv
 
Automate That! Scripting Atlassian applications in Python
Atlassian
 
Automate that
Atlassian
 
REST Web Sebvice
khmerforge
 
API Design- Best Practices
Prakash Bhandari
 
Rest web services
Paulo Gandra de Sousa
 
Android App Development 06 : Network & Web Services
Anuchit Chalothorn
 
Consuming GRIN GLOBAL Webservices
Edwin Rojas
 
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
Matt O'Keefe
 
Service approach for development Rest API in Symfony2
Sumy PHP User Grpoup
 

More from Uri Lavi (8)

PPTX
JavaScript TDD
Uri Lavi
 
PPTX
Intro to Mahout
Uri Lavi
 
PPT
Cloud Aware Architecture
Uri Lavi
 
PPTX
Software craftsmanship - 4
Uri Lavi
 
PPTX
Software Craftsmanship - 3
Uri Lavi
 
PPTX
Software Craftsmanship - 2
Uri Lavi
 
PPTX
Software Craftsmanship - 1 Meeting
Uri Lavi
 
PPTX
Effective Code Review
Uri Lavi
 
JavaScript TDD
Uri Lavi
 
Intro to Mahout
Uri Lavi
 
Cloud Aware Architecture
Uri Lavi
 
Software craftsmanship - 4
Uri Lavi
 
Software Craftsmanship - 3
Uri Lavi
 
Software Craftsmanship - 2
Uri Lavi
 
Software Craftsmanship - 1 Meeting
Uri Lavi
 
Effective Code Review
Uri Lavi
 

Recently uploaded (20)

PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
The Future of Artificial Intelligence (AI)
Mukul
 
Doc9.....................................
SofiaCollazos
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Software Development Methodologies in 2025
KodekX
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 

API Best Practices

  • 1. API Best Practices @urilavi http://bit.ly/scisr
  • 2. Public API/ Web API HTTP / HTTPS XML/JSON
  • 3. Rule #0 http://www.flickr.com/photos/holeymoon/2131118247/
  • 4. Rule #1 - Funnel Try Build Adopt
  • 5. Simplicity? TDD public API At least 3 clients Different languages http://www.flickr.com/photos/giosp/3933753363/
  • 6. Cross Cutting Concerns Authentication/Authorization Versioning Sync/Async Re-entrance Pagination Caching Throttling
  • 7. RESTfulness * Use plural names (reads better with GET) * Avoid methods (it isn’t traversal and grows fast) Nouns (Method-less) 2 base URLS per resource /events /events/10
  • 8. RESTfulness HTTP Verbs on collections/elements Create POST /events Fetch GET /events/12345 Update PUT /events/12345
  • 9. Method-based * Use verbs * Make the documentation clear that these are “non resource” operations Convert Translate
  • 10. Rule #2 - Relationships
  • 11. Rule #2 - Relationships Keep it simple - 3 levels
  • 12. Rule #2 - Relationships Keep it simple - 3 levels GET /lecturers/events/10
  • 13. Rule #3 - Complexity? http://www.flickr.com/photos/takomabibelot/4373062612/
  • 14. Rule #4 - Versioning * Maintain at least one version back GET api/v1/events/10
  • 15. Rule #4 - Versioning * Maintain at least one version back GET api/v1/events/10
  • 16. Rule #5 - Errors HTTP status codes {200, 400, 500} Verbose messages link to documentation
  • 17. Rule #6 - Sync / Async Result available - sync Result available in x time - async PicScout’s API
  • 18. Rule #7- Re-entrance http://www.flickr.com/photos/leovan/2152274834/ POST /funds/accounts/1000/ {‘value’: 100, ‘token’: ‘xbds213’}
  • 19. Rule #8 - Formatting JaaD = JSON as a Default
  • 20. Rule #9 - Automation? http://www.flickr.com/photos/r80o/39304743/ APIs are for humans

Editor's Notes