Not a book, but the best recorded talk ever given about API design is (IMO) by Joshua Bloch, in a 2007 tech talk at Google. "How to Design a Good API and Why It Matters".<p>He was one of the creators of the Java Collections API and the Java Executor Framework, two of the most durable and most widely-copied APIs ever. That may not seem relevant for an HTTP/REST API, but it is. The design principles are timeless. Here's that reference:<p><a href="https://twitter.com/amontalenti/status/1260030567501840386?s=19" rel="nofollow">https://twitter.com/amontalenti/status/1260030567501840386?s...</a><p>When I had to design a widely-used "HTTP/RESTful" API a few years back, I wrote a summary of the design principles here. It also includes a reference to an old O'Reilly book on the topic, which I summarized:<p><a href="https://www.parse.ly/help/api/restful-apis" rel="nofollow">https://www.parse.ly/help/api/restful-apis</a>
Don Norman’s “The Design of Everyday Things” (<a href="https://en.m.wikipedia.org/wiki/The_Design_of_Everyday_Things" rel="nofollow">https://en.m.wikipedia.org/wiki/The_Design_of_Everyday_Thing...</a>). Yes, API design has its own gotchas and specific practices—but some of the best (and worst) APIs I’ve ever interacted with were good (or bad) for the same reasons any kind of design can be good ( or bad): affordances, feedback, coherent conceptual models, and so on.
Stripe blog posts are unparalleled<p><a href="https://stripe.com/blog/api-versioning" rel="nofollow">https://stripe.com/blog/api-versioning</a><p><a href="https://stripe.com/blog/idempotency" rel="nofollow">https://stripe.com/blog/idempotency</a><p>It goes beyond "what is rest" and real life UX of apis
I’d highly recommend reading Roy Fielding’s dissertation paper where he introduced REST.<p>For anyone who hasn’t read it, it will fundamentally change how you think about REST and APIs for network services, and you’ll create much better APIs armed with that deeper understanding.<p>Paper: <a href="https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm" rel="nofollow">https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm</a><p>Chapter introducing REST: <a href="https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm" rel="nofollow">https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arc...</a>
<a href="https://apisyouwonthate.com" rel="nofollow">https://apisyouwonthate.com</a> and their book(s) offer good advices.<p>Not a book, but MS REST API Guidelines are pretty good although they don't cover funky important details like how to properly do REST operations/actions.<p><a href="https://github.com/microsoft/api-guidelines" rel="nofollow">https://github.com/microsoft/api-guidelines</a><p>This is short one based on RedHat VM engineer experience:<p><a href="https://restful-api-design.readthedocs.io/en/latest/intro.html" rel="nofollow">https://restful-api-design.readthedocs.io/en/latest/intro.ht...</a><p>Manning has a solid books on topic:<p><a href="https://www.manning.com/books/the-design-of-web-apis" rel="nofollow">https://www.manning.com/books/the-design-of-web-apis</a><p><a href="https://www.manning.com/books/api-design-patterns" rel="nofollow">https://www.manning.com/books/api-design-patterns</a>
I've found <a href="https://aip.dev" rel="nofollow">https://aip.dev</a> really useful! In fact this is a canonical resource for building REST apis at Google.
I would suggest having a close look at the OpenAPI specification as a way to bound and constrain your REST API design: <a href="https://swagger.io/specification/" rel="nofollow">https://swagger.io/specification/</a><p>Once you start thinking in terms of requests, responses, parameters, schemas etc the rest should easily fall into place! You also get the benefit of having a machine readable definition of your API if you write your design with the spec.
About REST : REST API Design Rulebook by Mark Massé (O'Reilly).<p>My reference when I'm designing a REST API.<p><a href="https://www.oreilly.com/library/view/rest-api-design/9781449317904/" rel="nofollow">https://www.oreilly.com/library/view/rest-api-design/9781449...</a>
Domain Driven Design: <a href="https://smile.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215" rel="nofollow">https://smile.amazon.com/Domain-Driven-Design-Tackling-Compl...</a><p>It's not about designing APIs, it's about designing your software to reflect the reality you're encoding into your software. It's a book of first principles that you can apply to any software you design.
Not a book, but the current issue of <a href="https://increment.com/" rel="nofollow">https://increment.com/</a> is about APIs.
I found JSON:API to be a great starting point, especially for small teams that want to get started right away. You can either adopt it or use it as a guideline for all the topics you need to consider.<p><a href="https://jsonapi.org/format/" rel="nofollow">https://jsonapi.org/format/</a>
Do people still design rest-ful APIs? I often find I end up needing to do RPC-like things that make the API end up as a weird hybrid. I'm on the verge of abandoning the idea of trying to be rest-ful at all, so it's less incohesive.
I don't have any book recommendations to make since API design is more art than science. As such I'd recommend that you beta test the API (route names, payloads, etc) with a few potential users to gauge durability and the ease with which users can intuit. The last thing you want is to release new version quickly or to require users to always refer to your documentation.<p>Some of these problems can be solved with an SDK (highly recommend, as it can greatly improve developer experience especially in a modern text editor or IDE) or switching to GraphQL (not without its own problems).
If you use gRPC, I think you can see Google API Design [1] useful.<p>[1] <a href="https://cloud.google.com/apis/design" rel="nofollow">https://cloud.google.com/apis/design</a>
This book is really good: <a href="https://www.manning.com/books/the-design-of-web-apis" rel="nofollow">https://www.manning.com/books/the-design-of-web-apis</a><p>It even spends the first few chapters talking about API design in general (not just for REST) with really great, intuitive examples.
Please check "The C Interfaces and Implementations" book by David Hanson [1]. Someone has implemented the concept using his library that you can check and use [2].<p>Another excellent reference is the "The Linux Programming Interface" book by Michael Kerrisk that documents most of the API available under Linux [3].<p>[1]<a href="https://www.amazon.com/dp/0201498413" rel="nofollow">https://www.amazon.com/dp/0201498413</a><p>[2]<a href="https://github.com/gon1332/gonlibs" rel="nofollow">https://github.com/gon1332/gonlibs</a><p>[3]<a href="https://www.amazon.com/Linux-Programming-Interface-System-Handbook/dp/1593272200" rel="nofollow">https://www.amazon.com/Linux-Programming-Interface-System-Ha...</a>
Ebook from APIGee is pretty good, at least for me.<p><a href="https://pages.apigee.com/web-api-design-register.html" rel="nofollow">https://pages.apigee.com/web-api-design-register.html</a>
Great recommendations! For another perspective, I'd add O'Reilly's "Continuous API Management" with some chapters around designing APIs as products and suggestions around how to implement a lifecycle.
Also, strictly for design I'd also do what was suggested here and check API design guidelines from several sources. I like the Adidas one.
I really liked: The REST API Design Handbook by George Reese.<p>It is everything you need to know and thinks about the angle of the people who need to consume your API. Quick read too.<p><a href="https://www.amazon.com/REST-API-Design-Handbook-ebook/dp/B00890OBFI" rel="nofollow">https://www.amazon.com/REST-API-Design-Handbook-ebook/dp/B00...</a>
I analyzed 24 blog posts on API design (rest/graphql/rpc) and compiled a list of the books they recommended (sorted by the most popular ones first) <a href="https://www.readthistwice.com/lists/best-api-design-books" rel="nofollow">https://www.readthistwice.com/lists/best-api-design-books</a>.
Ignore the fact that this is a book about .NET, it's an excellent source of wisdom about the design of APIs:<p><a href="https://www.amazon.com/dp/0321545613/ref=cm_sw_r_cp_apa_i_wnivFbAXFCB24" rel="nofollow">https://www.amazon.com/dp/0321545613/ref=cm_sw_r_cp_apa_i_wn...</a>
Not a book, but the best advice on API design I've ever seen was in 2004 by Casey Muratori on his talk "Designing and Evaluating Reusable Components".<p><a href="https://www.youtube.com/watch?v=ZQ5_u8Lgvyk" rel="nofollow">https://www.youtube.com/watch?v=ZQ5_u8Lgvyk</a>
Not a book, but this is a great talk about [How to Design Great APIs - Parse Developer Day 2013](<a href="https://www.youtube.com/watch?v=qCdpTji8nxo" rel="nofollow">https://www.youtube.com/watch?v=qCdpTji8nxo</a>)
I like Framework Design Guidelines by Cwalina, Barton, and Abrams. The 3rd edition was recently released.<p>It's targeted at developing .NET frameworks with a broad audience so some of the guidelines aren't appropriate for internal APIs or applications.
Casey Muratori (Rad Game Tools, Handmade Hero) talk from 2004 covers reusability and design for ease of use.<p><a href="https://caseymuratori.com/blog_0024" rel="nofollow">https://caseymuratori.com/blog_0024</a>
I wrote a popular blog post on this one:<p><a href="https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api" rel="nofollow">https://www.vinaysahni.com/best-practices-for-a-pragmatic-re...</a>
Moesif has many free resources for API design, development, and maintenence.<p><a href="https://www.moesif.com/blog/api-guide/" rel="nofollow">https://www.moesif.com/blog/api-guide/</a>
<a href="https://github.com/microsoft/api-guidelines" rel="nofollow">https://github.com/microsoft/api-guidelines</a><p>REST API guidelines from Microsoft
for REST APIs, <a href="https://apisyouwonthate.com/books/build-apis-you-wont-hate" rel="nofollow">https://apisyouwonthate.com/books/build-apis-you-wont-hate</a> book is my recommendation if you haven't read it already. I read it as a beginner, so it was kind of an eye opener for me on why we should do things a certain way when it comes to API.
Google published their guidelines for designing APIs [0]<p>[0] <a href="https://cloud.google.com/apis/design" rel="nofollow">https://cloud.google.com/apis/design</a>
Sure, read some books.<p>But know that they're all wrong. Some fatally.<p>The best you can do, ever, is to be consistent. So pick a style and stick to it. Honor the principle of least astonishment.