Key takeaways
- REST is the simple, universal default, and the best choice when other companies or many kinds of clients will use your API.
- GraphQL lets clients ask for exactly the data they need, which helps complex apps with many screens, at the cost of more machinery.
- tRPC shares types between server and client in a TypeScript codebase, which makes full-stack development very productive.
- Most products should start with the simplest option that fits their team and clients.
- Good design, versioning, authentication and documentation matter more than the style you pick.
What an API style decides
Your front end, whether a website or a mobile app, needs data from your back end. An API style is the contract for that conversation: how the client asks, what shape the answer takes and how changes are managed. Choosing one affects development speed, performance and how easily others can integrate with you.
The three options
| REST | GraphQL | tRPC | |
|---|---|---|---|
| Idea | Resources at URLs, standard HTTP methods | One endpoint, clients describe the data they want | Call server functions with end-to-end types |
| Best for | Public and partner APIs, simple apps | Complex, data-heavy UIs with many clients | TypeScript full-stack apps owned by one team |
| Strengths | Universal, cacheable, easy tooling | No over- or under-fetching, strong schema | Fast to build, type-safe, little boilerplate |
| Watch out for | Many endpoints, versioning | Complexity, caching, query cost control | Tied to TypeScript, not for public APIs |
Choose REST when
- You expect partners or customers to integrate with your API.
- Your team is mixed or your clients use many languages.
- You want simple caching, monitoring and tooling.
- You are building an MVP and want the least surprising choice.
Choose GraphQL when
- Several clients, such as web, iOS and Android, need different slices of the same data.
- Screens combine data from many sources and you are tired of chaining requests.
- You have the capacity to manage a schema, query limits and performance monitoring.
Choose tRPC when
- Your front end and back end are in TypeScript and developed together, often in one repository.
- Speed of development and type safety matter more than outside access.
- You do not need a public API, or you can add a REST layer for external users later.
What matters more than the style
- Authentication and authorisation checked on the server for every request.
- Input validation and rate limiting.
- Clear errors and versioning so changes do not break clients.
- Documentation and examples, even for internal APIs.
- Observability so you can find slow or failing calls.
Pick the simplest option that fits your team, and revisit when your product changes. If you want help designing the foundations of a new product, see our 8-week MVP plan or talk to our web app development team. AI-assisted coding, covered in our team guide, works best when the API contract is clear.