TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Suggestions for books about API design?

298 点作者 mcrittenden超过 4 年前
In my case I'm specifically building a REST API with Lambda, but I'd be interested in any API design books you found valuable.

37 条评论

pixelmonkey超过 4 年前
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. &quot;How to Design a Good API and Why It Matters&quot;.<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&#x2F;REST API, but it is. The design principles are timeless. Here&#x27;s that reference:<p><a href="https:&#x2F;&#x2F;twitter.com&#x2F;amontalenti&#x2F;status&#x2F;1260030567501840386?s=19" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;amontalenti&#x2F;status&#x2F;1260030567501840386?s...</a><p>When I had to design a widely-used &quot;HTTP&#x2F;RESTful&quot; API a few years back, I wrote a summary of the design principles here. It also includes a reference to an old O&#x27;Reilly book on the topic, which I summarized:<p><a href="https:&#x2F;&#x2F;www.parse.ly&#x2F;help&#x2F;api&#x2F;restful-apis" rel="nofollow">https:&#x2F;&#x2F;www.parse.ly&#x2F;help&#x2F;api&#x2F;restful-apis</a>
评论 #24384282 未加载
评论 #24388300 未加载
评论 #24385569 未加载
评论 #24386713 未加载
评论 #24387887 未加载
riwsky超过 4 年前
Don Norman’s “The Design of Everyday Things” (<a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;The_Design_of_Everyday_Things" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;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.
评论 #24386212 未加载
评论 #24384737 未加载
sandGorgon超过 4 年前
Stripe blog posts are unparalleled<p><a href="https:&#x2F;&#x2F;stripe.com&#x2F;blog&#x2F;api-versioning" rel="nofollow">https:&#x2F;&#x2F;stripe.com&#x2F;blog&#x2F;api-versioning</a><p><a href="https:&#x2F;&#x2F;stripe.com&#x2F;blog&#x2F;idempotency" rel="nofollow">https:&#x2F;&#x2F;stripe.com&#x2F;blog&#x2F;idempotency</a><p>It goes beyond &quot;what is rest&quot; and real life UX of apis
danpalmer超过 4 年前
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:&#x2F;&#x2F;www.ics.uci.edu&#x2F;~fielding&#x2F;pubs&#x2F;dissertation&#x2F;top.htm" rel="nofollow">https:&#x2F;&#x2F;www.ics.uci.edu&#x2F;~fielding&#x2F;pubs&#x2F;dissertation&#x2F;top.htm</a><p>Chapter introducing REST: <a href="https:&#x2F;&#x2F;www.ics.uci.edu&#x2F;~fielding&#x2F;pubs&#x2F;dissertation&#x2F;rest_arch_style.htm" rel="nofollow">https:&#x2F;&#x2F;www.ics.uci.edu&#x2F;~fielding&#x2F;pubs&#x2F;dissertation&#x2F;rest_arc...</a>
评论 #24385423 未加载
评论 #24463507 未加载
评论 #24384716 未加载
majkinetor超过 4 年前
<a href="https:&#x2F;&#x2F;apisyouwonthate.com" rel="nofollow">https:&#x2F;&#x2F;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&#x27;t cover funky important details like how to properly do REST operations&#x2F;actions.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;microsoft&#x2F;api-guidelines" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;microsoft&#x2F;api-guidelines</a><p>This is short one based on RedHat VM engineer experience:<p><a href="https:&#x2F;&#x2F;restful-api-design.readthedocs.io&#x2F;en&#x2F;latest&#x2F;intro.html" rel="nofollow">https:&#x2F;&#x2F;restful-api-design.readthedocs.io&#x2F;en&#x2F;latest&#x2F;intro.ht...</a><p>Manning has a solid books on topic:<p><a href="https:&#x2F;&#x2F;www.manning.com&#x2F;books&#x2F;the-design-of-web-apis" rel="nofollow">https:&#x2F;&#x2F;www.manning.com&#x2F;books&#x2F;the-design-of-web-apis</a><p><a href="https:&#x2F;&#x2F;www.manning.com&#x2F;books&#x2F;api-design-patterns" rel="nofollow">https:&#x2F;&#x2F;www.manning.com&#x2F;books&#x2F;api-design-patterns</a>
krat0sprakhar超过 4 年前
I&#x27;ve found <a href="https:&#x2F;&#x2F;aip.dev" rel="nofollow">https:&#x2F;&#x2F;aip.dev</a> really useful! In fact this is a canonical resource for building REST apis at Google.
disposedtrolley超过 4 年前
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:&#x2F;&#x2F;swagger.io&#x2F;specification&#x2F;" rel="nofollow">https:&#x2F;&#x2F;swagger.io&#x2F;specification&#x2F;</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.
tj612超过 4 年前
About REST : REST API Design Rulebook by Mark Massé (O&#x27;Reilly).<p>My reference when I&#x27;m designing a REST API.<p><a href="https:&#x2F;&#x2F;www.oreilly.com&#x2F;library&#x2F;view&#x2F;rest-api-design&#x2F;9781449317904&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.oreilly.com&#x2F;library&#x2F;view&#x2F;rest-api-design&#x2F;9781449...</a>
评论 #24384511 未加载
hoorayimhelping超过 4 年前
Domain Driven Design: <a href="https:&#x2F;&#x2F;smile.amazon.com&#x2F;Domain-Driven-Design-Tackling-Complexity-Software&#x2F;dp&#x2F;0321125215" rel="nofollow">https:&#x2F;&#x2F;smile.amazon.com&#x2F;Domain-Driven-Design-Tackling-Compl...</a><p>It&#x27;s not about designing APIs, it&#x27;s about designing your software to reflect the reality you&#x27;re encoding into your software. It&#x27;s a book of first principles that you can apply to any software you design.
yhoiseth超过 4 年前
Not a book, but the current issue of <a href="https:&#x2F;&#x2F;increment.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;increment.com&#x2F;</a> is about APIs.
评论 #24389063 未加载
timclark超过 4 年前
A philosophy of software design - John Ousterhout<p>This has an interesting generic discussion of API design which is technology agnostic.
评论 #24387641 未加载
makstaks超过 4 年前
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:&#x2F;&#x2F;jsonapi.org&#x2F;format&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jsonapi.org&#x2F;format&#x2F;</a>
rantwasp超过 4 年前
The Little Manual of API design<p>You can read it in an hour or two. It cover a lot of things that you should consider
评论 #24387946 未加载
评论 #24384468 未加载
thanhhaimai超过 4 年前
Check out Google AIP<p><a href="https:&#x2F;&#x2F;google.aip.dev&#x2F;general" rel="nofollow">https:&#x2F;&#x2F;google.aip.dev&#x2F;general</a>
beaker52超过 4 年前
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&#x27;m on the verge of abandoning the idea of trying to be rest-ful at all, so it&#x27;s less incohesive.
评论 #24384548 未加载
评论 #24384222 未加载
评论 #24388371 未加载
评论 #24383988 未加载
评论 #24389782 未加载
yawboakye超过 4 年前
I don&#x27;t have any book recommendations to make since API design is more art than science. As such I&#x27;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).
anhldbk超过 4 年前
If you use gRPC, I think you can see Google API Design [1] useful.<p>[1] <a href="https:&#x2F;&#x2F;cloud.google.com&#x2F;apis&#x2F;design" rel="nofollow">https:&#x2F;&#x2F;cloud.google.com&#x2F;apis&#x2F;design</a>
nicwest超过 4 年前
Consumer centric API design<p><a href="https:&#x2F;&#x2F;github.com&#x2F;tlhunter&#x2F;consumer-centric-api-design" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tlhunter&#x2F;consumer-centric-api-design</a>
评论 #24385087 未加载
评论 #24384502 未加载
dudul超过 4 年前
This book is really good: <a href="https:&#x2F;&#x2F;www.manning.com&#x2F;books&#x2F;the-design-of-web-apis" rel="nofollow">https:&#x2F;&#x2F;www.manning.com&#x2F;books&#x2F;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.
teleforce超过 4 年前
Please check &quot;The C Interfaces and Implementations&quot; 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 &quot;The Linux Programming Interface&quot; book by Michael Kerrisk that documents most of the API available under Linux [3].<p>[1]<a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;dp&#x2F;0201498413" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;dp&#x2F;0201498413</a><p>[2]<a href="https:&#x2F;&#x2F;github.com&#x2F;gon1332&#x2F;gonlibs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gon1332&#x2F;gonlibs</a><p>[3]<a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;Linux-Programming-Interface-System-Handbook&#x2F;dp&#x2F;1593272200" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;Linux-Programming-Interface-System-Ha...</a>
billfruit超过 4 年前
API design in C++ by Martin Reddy is a good text.
评论 #24384193 未加载
HuShifang超过 4 年前
Maybe Lauret&#x27;s <i>The Design of Web APIs</i>? [0]<p>[0]: <a href="https:&#x2F;&#x2F;www.manning.com&#x2F;books&#x2F;the-design-of-web-apis" rel="nofollow">https:&#x2F;&#x2F;www.manning.com&#x2F;books&#x2F;the-design-of-web-apis</a>
raitucarp超过 4 年前
Ebook from APIGee is pretty good, at least for me.<p><a href="https:&#x2F;&#x2F;pages.apigee.com&#x2F;web-api-design-register.html" rel="nofollow">https:&#x2F;&#x2F;pages.apigee.com&#x2F;web-api-design-register.html</a>
manuu80超过 4 年前
Great recommendations! For another perspective, I&#x27;d add O&#x27;Reilly&#x27;s &quot;Continuous API Management&quot; with some chapters around designing APIs as products and suggestions around how to implement a lifecycle. Also, strictly for design I&#x27;d also do what was suggested here and check API design guidelines from several sources. I like the Adidas one.
rajvosa07超过 4 年前
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:&#x2F;&#x2F;www.amazon.com&#x2F;REST-API-Design-Handbook-ebook&#x2F;dp&#x2F;B00890OBFI" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;REST-API-Design-Handbook-ebook&#x2F;dp&#x2F;B00...</a>
vhpoet超过 4 年前
I analyzed 24 blog posts on API design (rest&#x2F;graphql&#x2F;rpc) and compiled a list of the books they recommended (sorted by the most popular ones first) <a href="https:&#x2F;&#x2F;www.readthistwice.com&#x2F;lists&#x2F;best-api-design-books" rel="nofollow">https:&#x2F;&#x2F;www.readthistwice.com&#x2F;lists&#x2F;best-api-design-books</a>.
idan超过 4 年前
Ignore the fact that this is a book about .NET, it&#x27;s an excellent source of wisdom about the design of APIs:<p><a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;dp&#x2F;0321545613&#x2F;ref=cm_sw_r_cp_apa_i_wnivFbAXFCB24" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;dp&#x2F;0321545613&#x2F;ref=cm_sw_r_cp_apa_i_wn...</a>
matiasfernandez超过 4 年前
Not a book, but the best advice on API design I&#x27;ve ever seen was in 2004 by Casey Muratori on his talk &quot;Designing and Evaluating Reusable Components&quot;.<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=ZQ5_u8Lgvyk" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=ZQ5_u8Lgvyk</a>
thallavajhula超过 4 年前
Not a book, but this is a great talk about [How to Design Great APIs - Parse Developer Day 2013](<a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=qCdpTji8nxo" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=qCdpTji8nxo</a>)
tjalfi超过 4 年前
I like Framework Design Guidelines by Cwalina, Barton, and Abrams. The 3rd edition was recently released.<p>It&#x27;s targeted at developing .NET frameworks with a broad audience so some of the guidelines aren&#x27;t appropriate for internal APIs or applications.
javierecf超过 4 年前
Casey Muratori (Rad Game Tools, Handmade Hero) talk from 2004 covers reusability and design for ease of use.<p><a href="https:&#x2F;&#x2F;caseymuratori.com&#x2F;blog_0024" rel="nofollow">https:&#x2F;&#x2F;caseymuratori.com&#x2F;blog_0024</a>
veesahni超过 4 年前
I wrote a popular blog post on this one:<p><a href="https:&#x2F;&#x2F;www.vinaysahni.com&#x2F;best-practices-for-a-pragmatic-restful-api" rel="nofollow">https:&#x2F;&#x2F;www.vinaysahni.com&#x2F;best-practices-for-a-pragmatic-re...</a>
k__超过 4 年前
Moesif has many free resources for API design, development, and maintenence.<p><a href="https:&#x2F;&#x2F;www.moesif.com&#x2F;blog&#x2F;api-guide&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.moesif.com&#x2F;blog&#x2F;api-guide&#x2F;</a>
ayush--s超过 4 年前
<a href="https:&#x2F;&#x2F;github.com&#x2F;microsoft&#x2F;api-guidelines" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;microsoft&#x2F;api-guidelines</a><p>REST API guidelines from Microsoft
shivenigma超过 4 年前
for REST APIs, <a href="https:&#x2F;&#x2F;apisyouwonthate.com&#x2F;books&#x2F;build-apis-you-wont-hate" rel="nofollow">https:&#x2F;&#x2F;apisyouwonthate.com&#x2F;books&#x2F;build-apis-you-wont-hate</a> book is my recommendation if you haven&#x27;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.
simonpure超过 4 年前
Google published their guidelines for designing APIs [0]<p>[0] <a href="https:&#x2F;&#x2F;cloud.google.com&#x2F;apis&#x2F;design" rel="nofollow">https:&#x2F;&#x2F;cloud.google.com&#x2F;apis&#x2F;design</a>
specialist超过 4 年前
Sure, read some books.<p>But know that they&#x27;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.