Library · Summary & review

The Design of Web APIs

By Arnaud Lauret (2nd edition). The complete method for designing web APIs from the point of view of whoever consumes them.

FR EN
The Design of Web APIs book cover, Arnaud Lauret

The Design of Web APIs

The Design of Web APIs, Second Edition

7.7 /10

« The book that designs the API for whoever uses it, not whoever coded it. »

  • AuthorArnaud Lauret · « API Handyman »
  • OriginalManning, 2025 · 536 pages
  • Edition2nd edition (2025), English only
  • This page~10 min read
Book rating across 6 dimensionsIdeas7.5/10Practical8.5/10Readability7/10Aged well8.5/10Examples8.5/10Depth6/10

The complete method for designing clear web APIs from the point of view of whoever consumes them.

Why this book

We all learn to consume APIs (the interfaces programs use to talk to each other) before we ever design one. And the day we ship one, it shows: a field named sts, a homemade date format, an operation that dumps a database table as-is. The consumer struggles, swears, and ends up writing three functions to undo our choices. Designing an API isn't something you improvise, and that's exactly what almost nobody taught us.

Arnaud Lauret, a French author known as the "API Handyman", wrote The Design of Web APIs, the missing book. This 2nd edition from 2025 takes a subject usually handled by gut feeling and turns it into a method, from the business need all the way to the OpenAPI document (the standard file that describes an API). The thread isn't the technology, it's an obsession: everything is designed from the point of view of whoever will consume the API, never from the one who implements it.

The ideas that stick

The book runs 536 pages. Here is what stays with you once it's closed, in four families of ideas. Each answers a question:

1The Kitchen Radar: design for whoever uses it

Lauret opens with a thought experiment: what if a terrible API were a kitchen appliance? An API is the door through which one program uses another, and the program that calls it is its consumer. In the book, it's a microwave renamed "Kitchen Radar", whose only control is a button you hold down with precise timing to dose the magnetron (the part that produces the heat). To reheat your soup, you must become a magnetron expert. That's exactly what most APIs do. They make the consumer learn their internal machinery instead of letting it say what it wants to do. Ideas 3 and 4 show concrete cases.

The rule that runs through the whole book: you design from the consumer's point of view. People don't want to "turn on the magnetron", they want to "heat a dish". To keep the kitchen image, a good API is the restaurant waiter. He brings you the dish without showing you the kitchen, unlike the chef shouting the recipe at you. One question to keep for everything that follows: what does the caller of the API want to do?

An absurd retro microwave with a single cryptic dial and one confusing button, a baffled person in an apron holding a stopwatch and squinting at it
The Kitchen Radar: to heat your soup, become a magnetron expert.

2Recipes and ingredients: decide WHAT before HOW

With the consumer at the center, the next question is what it wants to do. Before choosing a single URL (the address of a resource) or HTTP verb (GET to read, POST to create), Lauret has you list, in plain language, what users want to accomplish. These are the use cases. For each one you note the operations the API must offer, meaning the actions a consumer can ask of it. His method fits in a table, the "API Capabilities Canvas", which links users, use cases and operations.

His image: use cases are recipes, and operations are their generic ingredients. A well-thought operation is generic ("heat food at a given power and time"), not specific ("heat milk and chocolate"). The first one also serves the soup, the second serves one dish only. Separating the WHAT (the capabilities, in plain words) from the HOW (REST, the common style of web APIs, and HTTP, their protocol) avoids a trap. Implementation reflexes, such as cutting the API along the database tables, would warp the design from the very start.

Here is what that table looks like, on an example of my own (it is not from the book). Two different use cases rely on the same generic operation:

UserUse caseOperation
CustomerPay a supplierCreate a transfer
CustomerSend money to a friendCreate a transfer
AdvisorCheck a customer's transfersList transfers

The order to remember: you decide the operations first, from what users want to do. The URL and the HTTP verb come after.

3Your API is not your database

Once the operations are designed around use, the data has the same trap. The most common sin is mirroring the database into the API, in three forms: a column with a cryptic name like CUSD, a table returned as-is, or a field like supplier.phone (a supplier's phone number) exposed just because it happens to be stored.

Lauret's rule: the data you exchange is a representation, meaning a presentation designed for whoever reads it, not a copy of your storage. Names, types, structure can all differ between the API and the database, and the server-side code does the translation. For an authorized overdraft, stored under the name CUSD, the consumer should see a clear field like overdraftFacility, never the raw column name or the schema of your tables. The next idea shows how to find a good name.

4The "wow" effect: predictable names give superpowers

A good name lets a developer guess the rest. Lauret's point: an intuitive API design gives developers a superpower, they can guess the available data and operations without reading the documentation, hence the "wow" effect of the title. He walks through cleaning up a banking field, as an example from the book: ACTBLNDFPRTFTBKACC becomes overdraftFacility.active, meaning an overdraftFacility object (the authorized overdraft) that contains active.

A clear name can be guessed. A standard is recognized: being interoperable means exchanging with other systems without translation, so reusing existing standards instead of inventing your own:

  • IBAN for an account (the international bank account number);
  • ISO 8601 for a date (2022-12-20T10:11:00Z instead of an unreadable Unix timestamp, a bare count of seconds since 1970);
  • GeoJSON for coordinates (a standard JSON format for places).

A developer who already knows the standard recognizes it and has zero documentation to read. In the two JSON responses below, ISO 8601 is the standard shown. The first one is cryptic (an unreadable name, a count of seconds), nobody can guess it:

{
  "ACTBLNDFPRTFTBKACC": true,
  "dt": 1671531060
}

The second has predictable names and a standard date, everyone can guess it:

{
  "overdraftFacility": {
    "active": true
  },
  "createdAt": "2022-12-20T10:11:00Z"
}

To remember: a name you can guess plus a standard you recognize, and the documentation becomes almost unnecessary. Next comes the case where a request is refused: the error message should be just as guessable.

5Errors: be generous, say everything at once

A clear name helps when all goes well. When a request is refused, the error has to do the talking. An empty 400 Bad Request (the HTTP code for "your request is wrong") is a slap. A useful error says what's wrong, where, and what's accepted. Above all, it returns ALL the problems at once, not one per round-trip: you don't make the consumer fix, resend, discover the next error, repeat. Here is the generous answer: a 400 with a problem+json body that says everything at once.

{
  "type": "validation-error",
  "errors": [
    {
      "field": "email",
      "issue": "invalid"
    },
    {
      "field": "age",
      "issue": "must be >= 18"
    }
  ]
}

Two references frame this. Postel's law: be liberal in what you accept, strict in what you send. Its second half is aimed at your responses, errors included. And RFC 9457 (an official internet standard, application/problem+json), the format of the example above, so that errors are predictable from one API to the next. To remember: an error should help you solve the problem, not just report it. But telling everything has a limit, what must not come out at all.

6The safest data is the data that doesn't exist

Telling everything in an error has a limit: what must not come out. The designer can't solve every security problem, but they decide the exposed surface, meaning everything the API shows or allows. The idea: the most secure data or operation is the one that doesn't exist. Three ways to apply it:

  • don't expose it at all;
  • mask it, meaning show only a piece of it (4444 instead of the full card number);
  • hide it behind a permission, an access right the consumer must hold.

And a warning that surprises everyone: HTTPS does NOT protect everything. It encrypts the wire, but the data ends up in logs (the journals where servers record requests), passes through intermediaries (relays between the client and the server), and lands on uncontrolled devices: your own banking app runs on the customer's phone.

Consequence: never put sensitive data in a URL, because URLs get logged. One last trap, believing an unreadable identifier protects: opacity isn't security, and an unreadable identifier is not an access control. To remember: when in doubt, don't expose it.

7The most efficient API call is the one that doesn't happen

Exposing less also means calling less. The book's dashboard example: a dashboard (a screen that gathers many figures) fires 100 parallel calls and takes up to 11 seconds, because the consumer has to assemble the data itself. The screen now makes a single call, GET /dashboard, and the page shows in 100 milliseconds: the assembly happens elsewhere, on the API side, instead of being delegated to the consumer. The most efficient API call is the one that doesn't happen.

That gain only holds if the API is the cause of the slowness. And Lauret is refreshingly honest: according to the book, many performance issues come from infrastructure and databases rather than from API design. The fix is often a missing index in the database (a lookup structure that speeds up queries). To remember: measure the real cause before adding complexity to the API.

8Change without breaking: stay on v1 as long as you can

Once the API is live, the job is to evolve it without breaking those who use it. As soon as it has consumers, every change risks breaking them. Lauret maps the two camps:

  • safe: adding an optional field, widening a limit;
  • breaking: renaming, removing, making a field required.

A change is safe when the programs that call the API keep working without being modified. Lauret also invokes Hyrum's Law: with enough users, every observable behavior of your API will end up being relied on by someone, documented or not. Your consumers therefore depend on everything they can see, not only on what you promised, and changing even an undocumented detail can break someone. Hence the consequence, which runs against the "let's go to version 2" reflex (a new version that replaces the old one): stay on version 1 as long as possible, and only break your consumers if it's truly worth the cost.

And design for extension from day one. The boolean (true or false) is a trap: it has only two states. The day a third one appears, say "pending", you have to rename the field, which is breaking. The enum (a fixed list of allowed values) leaves the door open. First the boolean, which stops being enough the day "pending" arrives:

{
  "executed": true
}

The enum accepts one more value without breaking any client (then "pending", "cancelled"…):

{
  "status": "executed"
}

To remember: a list of values can grow without breaking anyone, a true-or-false cannot.

My take, honestly

This is the book that turns API design from something you fudge by feel into a real craft you can teach. The "consumer's point of view" discipline (idea 1), the recipes-and-ingredients method (idea 2), the rule never to expose your database (idea 3): I haven't seen it anywhere else laid out this clearly. And the metaphors land, the dumb microwave, the restaurant waiter: you remember them.

Its strength is also its restraint: Lauret never oversells. The publisher says this edition is fully revised and rewritten, with updated OpenAPI coverage and more than 70 exercises. He doesn't present REST as the only answer, and he admits many performance issues come from the database, not the API (idea 7). On a topic where most resources are dated, that's precious.

First reservation, the format. 536 pages, and a method systematic to the point of exhaustion. The book walks you step by step through the same running examples, chapter after chapter. The examples are excellent, but they march on relentlessly. It's a reference manual, not a book you devour: you read it with the keyboard next to you, or you dip into it when you need to.

Second reservation, it is centered on REST and HTTP. If you work with GraphQL or gRPC, its principles still hold, but you will have to translate the examples yourself.

My advice: read the parts on the need and on the data first (ideas 1 to 3), the ones that change the most how you design. Then dip into naming, errors and security when you need them, and keep idea 8 within reach before your first breaking change.

Odilon

Still relevant in 2026?

More than ever, and for a timely reason. APIs are no longer consumed only by humans and their apps: they're consumed by AI agents, programs driven by a language model (an LLM) that are handed "tools" to call.

And an agent has exactly the same needs as a human developer, only worse: a predictable, well-named, self-describing API. Everything this book teaches you to do for a developer's "wow" (idea 4) is precisely what lets an LLM call the right operation, the endpoint, with the right parameters.

His obsession with the consumer's point of view extends naturally to a consumer that isn't human.

Who is it for?

Read it if

  • You design or maintain REST APIs and you mostly do it by feel
  • You're sick of APIs that spit out the database as-is
  • You want a repeatable method, from the business need to the OpenAPI document
  • You're setting up API rules or governance in a team

Skip it if

  • You want a quick "an API in one hour" tutorial: this is a full method, not a quickstart
  • You do GraphQL or gRPC (two other API styles) exclusively: the book is REST/HTTP-centric, even if its principles apply beyond REST
  • You want pure concept: this is a hands-on, very systematic, sometimes repetitive manual

Going further

Comments (0)

On the same shelf

Software architecture

See the whole shelf (6 notes) →

Browse the whole library

More book notes coming: one book at a time, the marrow only.