Development7 min readMay 1, 2026

API Design for UX: What Frontend Developers Need Backend Developers to Know

The API is a design surface. Most backends aren't designed with UX in mind. Here's what should change.

The API is where backend and frontend meet. Most backend APIs are designed for correctness, not for the UX of the frontend developers who consume them โ€” or for the end users who experience the resulting product. Here's what frontend developers (and the designers they work with) wish backend developers thought about more.

Loading State Design

UIs need to show loading states. Loading states require knowing when data is loading. APIs that return instantly when the response is cached and take 2 seconds when it isn't make it impossible to design good loading experiences. Consistent, predictable response time profiles help. When fast is impossible, at minimum provide early-acknowledgment patterns (202 Accepted) so the UI can give immediate feedback.

Error Granularity

A 400 Bad Request that returns {"error": "Invalid input"} tells the frontend nothing about what field was invalid or why. For form validation, the API needs to return field-level error information. For payment errors, the error type determines what the user is told. Generic server errors are a frontend UX tax.

Pagination Patterns

Cursor-based pagination is generally better for infinite scroll UX than page-based pagination. Offset pagination produces inconsistent results when items are added or removed between pages. If your product has any list view that could eventually need infinite scroll or "load more," design cursor-based pagination from the start.

Response Shape Consistency

Inconsistent response shapes between endpoints are a frontend developer's nightmare and a source of UI bugs. If resource A returns { "data": [...] } and resource B returns [...] directly, every API call requires different handling. Consistent response envelopes dramatically reduce frontend boilerplate.

React to this article

Share this article

Share on XShare on LinkedIn

Newsletter

Enjoyed this? Get the next one.

New essays on design, fintech, and craft โ€” no filler. Unsubscribe any time.