What is a REST API?
A REST API is a widely used style for building APIs that work over the web. REST (Representational State Transfer) is a set of conventions, not a strict standard. The core idea is simple: everything is treated as a resource, each resource has its own web address (a URL), and you act on it using the same HTTP methods your browser already uses.
The four you meet most often are GET to read, POST to create, PUT to update, and DELETE to remove. So GET /users/42 reads user 42, and DELETE /users/42 removes them. Responses usually come back as JSON, a format both people and programs can read.
In plain words
Think of a REST API as a well-organized warehouse with clear aisle labels. Every item has a fixed address on a shelf. You do not invent a new way to ask for each item. You always use the same simple actions: fetch this one, put a new one here, replace what is on that shelf, throw that one out. Same verbs every time, just a different shelf address.
Why it matters
- It is the default. Most public web services, from payment providers to weather data, offer a REST API, so the skills transfer everywhere.
- It is predictable. Once you know the conventions, a new REST API feels familiar. The same methods do the same jobs.
- It is built on the web. REST rides on plain HTTP, so it works with existing tools, caches, and security without anything exotic.
Common pitfalls
- Over-fetching and under-fetching. A fixed endpoint often returns more data than you need, or too little, forcing several calls. For complex needs, look at GraphQL.
- Ignoring status codes. A REST API signals success or failure through HTTP codes like
200,404, and500. Treat them as part of the answer, not noise. - No versioning. When you change the shape of a response, older clients break. Version the API (for example
/v2/users) before you make breaking changes. - Forgetting rate limits. Most providers cap how many requests you may send. Hit the cap and calls start failing.
Related articles:
- What is an API? - The broader idea REST builds on, explained from scratch.
- What is GraphQL? - A different API style that lets the client ask for exactly the data it needs.
- Improve API adoption with the OpenAPI Specification - The common standard for documenting REST APIs.
Want to stay one step ahead?
Don't miss our best insights. No spam, just practical analyses, invitations to exclusive events, and podcast summaries delivered straight to your inbox.
