API Design
Resources, versions, pagination and contracts.
How to design APIs other people can rely on: HTTP from the ground up, REST resources, status codes and errors, payload design, pagination, idempotency, OpenAPI contracts, versioning and deprecation, gRPC, GraphQL, webhooks, real-time APIs, authentication with OAuth and tokens, API security, rate limits, caching, gateways and developer experience. Vendor-neutral: open standards (HTTP RFCs, OpenAPI, AsyncAPI, OAuth) alongside gateways from AWS, Google Cloud, Azure, Kong and others. By the end you can design, document and evolve an API without breaking the people who depend on it.
- 5
- chapters
- 21
- modules
- ~9h
- of learning
- 21
- live now
Take modules in any order. The route suggests one that builds up naturally.
has a live module in progress complete
Take a look inside
The big picture, before the details
One request to a parcel API, from a partner's app through the gateway and back, with the promises around it. Watch the tour, or click any part.
A partner's app: calls the API over HTTP: a method, a path, headers and a body (modules 1–3).
A taste of module 7: page through a list while orders arrive or are cancelled. Offsets repeat or skip; cursors don't.
shown twice: 118, 117, 116
The big picture
What an API is, the HTTP underneath, and the main styles.
3 modules · 70 min
Beginner
What an API is
A promise between programs, and why breaking it hurts.
Beginner
HTTP from the ground up
Requests, responses, methods, status codes and headers.
Beginner
REST, RPC, GraphQL and events
Four ways to shape an API, and when each fits.
Designing REST APIs
Resources, methods, errors and the shape of the data.
5 modules · 120 min
Core
Resources and URLs
Nouns, collections and sensible paths.
Core
Methods, status codes and errors
Saying what happened, in a way programs understand.
Core
Request and response design
JSON shapes that are easy to use and hard to misuse.
Core
Pagination, filtering and sorting
Handing over a million rows, a page at a time.
Core
Idempotency and safe retries
Making it safe to press 'pay' twice.
Contracts and change
Describing an API precisely, and changing it without breaking anyone.
3 modules · 70 min
Core
OpenAPI and contract-first design
One description for docs, mocks, tests and code.
Core
Versioning and breaking changes
Which changes break clients, and what to do about it.
Applied
Deprecation and lifecycle
Retiring an API version without surprising anyone.
Beyond REST
Binary RPC, flexible queries, push and real time.
4 modules · 95 min
Core
gRPC and Protocol Buffers
Fast, typed calls between services.
Core
GraphQL
Ask for exactly what you need, and the costs that come with it.
Core
Webhooks and async APIs
Telling clients when something happens.
Core
Real-time APIs
Polling, server-sent events and WebSockets.
Security and operations
Who may call, how often, how fast, and how people find out.
6 modules · 165 min
Core
Authentication: keys, OAuth and tokens
Proving who is calling.
Core
Authorisation and API security
The ways APIs really get breached.
Core
Rate limits and quotas
Protecting the API, fairly.
Core
Caching and performance
Faster responses, fewer bytes, less work.
Applied
Gateways and developer experience
Running APIs at scale, and making them pleasant to use.
Applied
Capstone: an API for a parcel service
Design it, publish it, then live with it for a year.