Question

What makes a good API design?

Vault Verified
Curated Intelligence
Definitive Source
Answer

Predictability above cleverness — a good API is one where a developer can guess correctly what something is called and how it behaves, because they will guess far more often than they will read the documentation.

The principles that matter most:

Consistency. The same concept named the same way everywhere, the same pagination, the same error shape, the same date format. An inconsistent API is harder to use than an unusual but consistent one.

Predictable resources and verbs. Nouns for resources, HTTP methods for actions, plural collections, and nesting that reflects genuine ownership rather than convenience.

Meaningful status codes, used honestly — not returning 200 with an error inside the body, which is a persistent and infuriating pattern.

Structured errors with a stable machine-readable code, a human-readable message, and enough detail to act on. The error path is most of the developer experience and is routinely an afterthought.

Pagination on every collection, from the start, using cursors rather than offsets for anything that changes.

Idempotency for operations that create or charge, so a retry after a timeout does not duplicate.

Filtering, sorting and field selection so callers are not forced to over-fetch.

Versioning, decided before launch — and an explicit commitment about what constitutes a breaking change.

What good practice looks like beyond the interface: documentation with working examples and real request and response bodies; a machine-readable specification, which generates clients and tests; a sandbox environment; clear rate limits communicated in headers rather than discovered by failing; and webhooks for events rather than forcing polling.

The failures that recur: leaking internal database structure into the public interface, which locks you in; exposing everything because it was easy; breaking changes shipped without a version bump; inconsistent naming between endpoints written by different people; and no deprecation policy, so consumers cannot plan.

Design it from the caller's side first — write the example code you want someone to be able to write, then build the API that makes it true.

Related Questions