API design explained in plain terms means planning how one piece of software asks another piece of software for something, and how the answer comes back. The central question is what makes an API easy and safe to use, and the short answer is that a good API is clear, consistent, predictable, and honest about errors, so developers can build on it without guessing.
Think of a restaurant menu. You do not walk into the kitchen and cook for yourself; you read the menu, place an order in the form the kitchen expects, and receive a dish in return. An API is the menu for a software system: it lists what you can ask for, how to ask, and what you will get back.
Almost every app you use relies on APIs. A weather app asks a weather service for a forecast, a shop asks a payment service to take a card payment, and a map in a delivery app asks a mapping service for a route. Good design is what makes all of those exchanges reliable rather than fragile.
Key takeaways
- An API is a defined way for software systems to request things from each other.
- Good design is clear, consistent, and predictable, so developers rarely need to guess.
- Resources, clear naming, and sensible data shapes are the heart of a good API.
- Versioning, limits, and security protect both the provider and the users.
- Good documentation and clear errors matter as much as the design itself.
What an API is
API stands for application programming interface. It is a set of rules that lets one program use the abilities of another without knowing how the other works inside. The program making the request is called the client, and the program answering it is called the server.
A request usually names a resource, such as a customer, an order, or a weather forecast, and says what to do with it: fetch it, create it, change it, or delete it. The server checks the request, does the work, and sends back a response, usually as structured data, along with a status that says whether the request succeeded.
The most common style today is the web API, where requests travel over the same protocol that carries web pages. Within that style, REST is the best-known approach, organising things around resources and standard actions. Other styles exist, including GraphQL, which lets a client ask for exactly the fields it needs, and event-based APIs, which push updates as they happen.
Design is the work of deciding what those resources are, what they are called, what data they carry, and how they behave. Two APIs can offer the same abilities and yet feel entirely different to use, and the difference is almost always design.
Our guide to API gateways explains the layer that often sits in front of an API, handling traffic, limits, and security, and it is a useful companion to this article.
Resources and naming
A good API is built around resources, the things it deals with, rather than around actions. A shop API has resources such as products, orders, and customers. A request names the resource first, and the action is implied by the kind of request being made.
Naming should be clear and consistent. Resources are usually named with plain nouns, in the plural, such as orders rather than orderList or getOrders. A developer who has seen one part of the API should be able to guess the names used elsewhere, because the same pattern repeats throughout.
Relationships between resources should be visible in the design. An order belongs to a customer, so the API makes that relationship easy to express, rather than forcing the developer to piece it together from scattered calls. Clear relationships reduce mistakes and cut down on the number of requests needed.
Data shapes matter too. Each resource should return the fields a developer actually needs, in a consistent format, with dates, numbers, and text handled the same way everywhere. Surprises in data shape are a common source of bugs, and they are usually a design failure rather than a developer error.
Requests, responses, and errors
Every request should do one clear thing. A request that fetches a customer should fetch a customer, not also change their address as a side effect. When a single request tries to do too much, it becomes hard to test, hard to explain, and hard to fix when it goes wrong.
Responses should use standard status codes honestly. A successful request says so clearly, a missing resource says it is missing, and a request that the server cannot understand says why. Vague or misleading status codes force developers to guess, and guessing leads to fragile code.
Error messages deserve as much care as successful responses. A good error says what went wrong, in plain language, and suggests what to do about it. An error that only says something failed, with no detail, wastes the time of everyone who meets it.
Filtering, sorting, and paging should be built in from the start. A list of ten thousand orders is useless if the API can only return all of them at once. Letting the client ask for a page at a time, in a chosen order, keeps the API fast and usable as data grows.

Comparing API styles
| Aspect | REST | GraphQL |
|---|---|---|
| How data is requested | Fixed resource routes | Flexible queries |
| What comes back | Set fields per resource | Only the fields asked for |
| Learning curve | Gentle | Steeper |
| Best for | Simple, stable services | Complex, changing needs |
| Main risk | Too many requests | Overly heavy queries |
Versioning and change
APIs change over time, as new features are added and old ones are improved. Versioning is how a provider changes an API without breaking everyone who already uses it. The usual approach is to keep old versions working while new versions are introduced, giving developers time to move.
Breaking changes should be rare and clearly announced. Renaming a field, removing a resource, or changing what a response means can break every program that depends on the API. When such a change is unavoidable, it belongs in a new version, with a migration guide and a generous deadline.
Backwards-compatible changes, such as adding a new optional field, can usually be made without a new version. The rule is simple: never change what existing code relies on without warning. Trust is the real product of an API, and breaking changes spend it quickly.
Deprecation should be gentle. Mark the old way as no longer recommended, explain the replacement, and give a clear date after which it will stop working. Developers plan around such dates, and a provider that keeps its word earns loyalty.
Security and limits
An API must know who is calling it. Authentication proves the identity of the caller, usually with a key or a token, and authorisation decides what that caller is allowed to do. A customer should be able to see their own orders, but not those of another customer, and the API must enforce that on every request.
Input should never be trusted blindly. Every value sent to an API should be checked: is it the right type, within the allowed range, and free of anything harmful? Careful validation protects the service and its data from both mistakes and attacks.
Rate limits protect the service from overload, whether accidental or deliberate. A limit says how many requests a caller may make in a given period, and the API should say clearly when the limit has been reached and when the caller may try again. Our guide to GraphQL explains one style where limits matter especially, because a single flexible query can ask for a great deal at once.
Logging and monitoring matter too. A provider should be able to see how the API is used, which requests fail, and where performance suffers. That information is what turns complaints into fixes, and it is far harder to gather after the fact than to build in from the start.
API design checklist
- Design around clear resources with plain, consistent names.
- Make each request do one thing, and make its result predictable.
- Return honest status codes and error messages that explain what went wrong.
- Build in filtering, sorting, and paging for every list.
- Version the API and avoid breaking changes without warning and a migration guide.
- Authenticate every caller and check authorisation on every request.
- Validate all input before acting on it.
- Set fair rate limits and explain them clearly when they are reached.
- Write documentation with real examples, and keep it updated as the API changes.
Frequently asked questions
What is API design?
API design is the planning of how software systems request things from each other, including what resources exist, how they are named, what data they carry, and how errors and changes are handled. Good design makes an API clear, consistent, and predictable to use.
What is the difference between an API and a web service?
An API is the interface, the set of rules for asking and answering. A web service is a program that offers an API over the web. Every web service has an API, but not every API is a web service; some APIs connect programs running on the same machine.
What is REST?
REST is a style of API design that organises things around resources and uses standard web actions to fetch, create, change, or delete them. It is the most common style for web APIs, because it is simple, well understood, and easy to cache.
How do I know if an API is well designed?
Try using it without reading the documentation first. If you can guess the names, predict the responses, and understand the errors, it is probably well designed. If every call needs a search through the docs, the design is likely unclear or inconsistent.
Why do APIs need versioning?
Because APIs change, and programs built on them need time to adapt. Versioning lets a provider introduce improvements while keeping older versions working, so existing users are not broken overnight by a change they did not ask for.
Is GraphQL better than REST?
Neither is better in general. GraphQL suits clients with complex, changing data needs, because they can ask for exactly what they want. REST suits simpler, stable services, because it is easier to learn, cache, and monitor. The right choice depends on the problem.
The bottom line
API design explained in one line is this: the craft of making software systems easy to talk to, by naming things clearly, answering honestly, and changing carefully.
A well-designed API feels obvious in use, and that obviousness is the result of deliberate choices about resources, errors, versions, and security. It is work that pays for itself every time a developer builds on it without friction.
This article is general information about how API design works, not advice about which style or tools suit a particular project.







