Every list screen you've ever shipped — a feed, a search results page, an admin table — is backed by an API decision your engineers made before you ever saw a wireframe. That decision, usually offset pagination vs cursor pagination, plus which fields are filterable and sortable, quietly determines whether "infinite scroll" or "jump to page 14" is even possible.
Quick Answer: APIs paginate because returning an entire dataset in one response is slow, expensive, and often impossible at scale. The two dominant approaches — offset-based (
page=3&limit=20) and cursor-based (after=xyz123) — trade off simplicity and "jump to any page" against stability and performance on large, changing datasets. Filtering and sorting parameters then decide which views of that list a user can actually reach.
Most PMs treat pagination as an implementation detail engineering handles quietly in the background. It isn't. The shape of your list API dictates the UX you can build on top of it — and retrofitting a different UX later often means renegotiating the API contract, not just the front end.
Why an API Can't Just Return Everything
An API paginates because sending every row of a large or growing table in one response degrades performance, bloats payload size, and can crash the client rendering it. A table with 50,000 rows sent as a single JSON response might be tens of megabytes — unusable on mobile networks and expensive to generate on every request.
Three separate constraints push every list API toward pagination, and PMs benefit from knowing which one is binding in their case, because each implies a different fix.
- Database cost. A query that scans and returns 50,000 rows does real work on every request, even if the user only looks at the first 20. Databases are optimized to fetch bounded result sets quickly; unbounded ones force full or near-full table scans.
- Payload size. JSON is verbose. A row with a dozen fields, repeated 50,000 times, produces a multi-megabyte response — slow to transmit, slow to parse, slow to render, and costly against a mobile data plan.
- Client memory and render cost. Even if the payload arrives instantly, rendering 50,000 DOM nodes (or list items in a mobile app) will freeze the UI. Client-side virtualization helps, but it still needs the data delivered in chunks.
This is the same constraint discussed in how the web works: a PM's mental model — every request-response cycle has a cost, and a list endpoint is where that cost compounds fastest, because the same endpoint gets called again and again as a user scrolls, filters, and re-sorts.
The Naive Alternative and Why It Fails Fast
Some early-stage products skip pagination entirely and return everything, relying on the client to filter and slice. It works fine in a demo with 50 rows of seed data.
It breaks the moment real usage arrives: 10,000 customer records, a support queue that's grown for two years, or a catalog with tens of thousands of SKUs. By then, the "just return everything" assumption is baked into how the front end fetches and caches data, and unwinding it touches every screen that lists anything.
Offset Pagination vs Cursor Pagination: The Core Tradeoff
Offset pagination asks the server for a page number and a page size (?page=3&limit=20); cursor pagination asks for everything "after" an opaque pointer to the last item seen (?after=eyJpZCI6MTIzfQ&limit=20). Offset is simpler and supports jumping to arbitrary pages; cursor is more stable on data that changes between requests and scales better on very large datasets.
The distinction sounds like backend trivia, but it's the single biggest lever on what UX pattern is even feasible. If you've read what is an API for product managers, pagination parameters are the concrete example of a "contract decision" made in the API layer that reshapes what's buildable above it.
| Dimension | Offset pagination | Cursor pagination |
|---|---|---|
| Request shape | page=3&limit=20 or offset=40&limit=20 | after=<opaque_token>&limit=20 |
| Jump to arbitrary page | Yes — page 47 is a simple parameter change | No — you can only walk forward/backward from a known point |
| Behavior when rows are added/removed mid-session | Rows can shift between pages, causing duplicates or skipped items | Stable — the cursor anchors to a specific row, immune to insertions elsewhere |
| Performance on large offsets | Degrades — the database still has to count/skip past N rows | Stays roughly constant — the query starts directly from the cursor's position |
| "Total pages" / "total count" display | Easy — server can return total row count cheaply alongside | Often expensive or approximate, since counting the full set defeats the point |
| Typical UX pairing | Numbered pages, "jump to page" controls, admin tables | Infinite scroll, "load more," real-time or frequently-updated feeds |
| Common real-world use | Admin dashboards, reports, paginated search results | Social feeds, activity logs, chat history, real-time queues |
Neither is universally "better" — they optimize for different access patterns. A finance reporting tool where analysts jump between pages 12 and 47 needs offset. A social feed where new items are constantly inserted at the top needs cursor, or offset pagination will silently duplicate or drop items as the underlying data shifts underneath the page boundaries.
Why Offset Pagination Breaks Under Change
Offset pagination defines a page by position in a list, not by identity of a row — so when rows are added or removed while a user is paging through, the boundaries shift and items duplicate or vanish. This is invisible in a demo and painfully visible in production the first time a user complains that "the same item showed up twice" or "an item disappeared between pages."
Concretely: a user is viewing page 2 (rows 21-40, sorted by newest first). Three new rows get created while they're reading. Row 21 from their original view is now row 24 — it reappears on their next "page 2" load, because the API doesn't know what they already saw, only what "positions 21-40" currently contains.
Cursor pagination avoids this because the cursor is anchored to a specific row's identity (usually an ID or timestamp, often encoded and opaque to the client), not a numeric position. "Give me everything after row xyz" stays correct regardless of what got inserted elsewhere in the list.
How Pagination Style Dictates the UX You Can Build
The pagination style an API exposes directly determines whether your screen can support numbered pages, infinite scroll, or both — retrofitting the other pattern later usually requires backend changes, not just a front-end swap. This is the "shape dictates UX" principle in its most concrete form.
Consider two nearly identical screens with genuinely different underlying contracts:
- Numbered pages ("Page 1 2 3 ... 47," a "jump to page" input, a visible total count) needs offset pagination — the UI has to be able to ask for page 15 directly without having walked through pages 1-14 first, and it needs a total count to render the page-number range at all.
- Infinite scroll / "load more" (the pattern behind most modern feeds) pairs naturally with cursor pagination — the client never needs to know "page 15" exists, it just keeps asking "what's next after the last item I have," which is exactly what a cursor answers, and it stays correct even as new items arrive.
Trying to build numbered pages on top of a cursor-only API means either faking page numbers (unreliable, breaks on shifting data) or building a secondary count query — extra backend work that defeats part of cursor pagination's efficiency advantage. Trying to build silky-smooth infinite scroll on top of offset-only pagination mostly works, until the underlying data changes frequently enough that duplicates and gaps become visible.
This is the practical version of a lesson from technical debt explained for your CEO: a pagination choice made for a v1 admin table quietly forecloses a future "make it feel like a live feed" request unless someone renegotiates the API contract first.
A Concrete Example: Support Queue vs Activity Feed
A support ticket queue, sorted by priority, where agents jump between specific pages to triage, is a textbook offset case — agents want "show me page 3 of unassigned tickets" and a stable total count matters for workload planning.
An activity feed on a project page — comments, status changes, mentions, arriving continuously — is a textbook cursor case. Users scroll down expecting new items to keep loading smoothly, and nobody asks "take me to page 9 of the activity feed." Designing the feed screen without first confirming which pagination style the API team planned is how PMs end up promising a UX the endpoint can't support cleanly.
Filtering and Sorting: The Other Half of List API Design
Filtering and sorting parameters (?status=open&sort=-created_at) determine which subset and ordering of data a list screen can present, and — like pagination — they have to be designed into the API before a screen can offer a filter or sort control. A filter option in your wireframe that isn't a corresponding query parameter on the backend is not a real feature; it's a mockup.
Well-designed list endpoints typically expose these parameter families:
- Filter parameters (
status=open,assignee=123,created_after=2026-01-01) restrict which rows qualify before pagination even applies — the "which subset" question. - Sort parameters (
sort=-priority,created_at) determine ordering, often supporting multiple fields with a stated tie-break rule — the "in what order" question. - Search parameters (
q=refund+issue) usually run against a full-text index rather than a simple field match, and frequently have different performance characteristics than filters. - Field-selection parameters (
fields=id,name,status) trim the response shape itself, which matters once payload size becomes the binding constraint from earlier in this piece.
The subtle interaction PMs miss: filtering and pagination have to compose correctly, or "page 2" silently means something different depending on which filters are active. A cursor from an unfiltered request is not valid against a filtered request — the API has to either reject it cleanly or the client has to re-fetch from scratch when filters change. This is a common source of "the pagination broke when I added a filter" bugs that show up late in QA.
| Parameter type | Example | What it changes | Common PM mistake |
|---|---|---|---|
| Filter | status=open | Which rows qualify | Assuming any wireframe filter maps to an existing field with an index |
| Sort | sort=-created_at | Row order | Not specifying a tie-break for equal values, causing unstable ordering |
| Search | q=refund | Relevance-ranked subset | Expecting exact-match filter performance from a full-text search field |
| Field selection | fields=id,name | Response payload shape | Overlooking that trimming fields can break a client that expects the full object |
Sorting deserves one specific callout: sorting by a field that isn't indexed in the database can be dramatically slower than sorting by an indexed one, and that difference is invisible in a small dataset and painful at production scale. "Let users sort by any column" is a reasonable-sounding requirement in a spec that quietly requires an indexing conversation with engineering.
Designing List Endpoints Without Writing Code Yourself
You don't need to write backend code to reason precisely about pagination style, filter parameters, and sort fields before a screen gets built — sketching the endpoint shape first is what prevents the "which subset is page 2 when a filter is active" bugs described above. Prodinja's API Designing tool lets you build list endpoints — defining the pagination style, filter parameters, and sortable fields — directly, and see them expressed as a real spec and a runnable curl command.
That matters most exactly at the moment described in this article: before committing to infinite scroll or numbered pages in a wireframe, checking that the endpoint underneath actually supports the pagination style the screen assumes. It's a prototype tool for thinking through the contract, not a production API gateway — but the exercise of writing the parameters down surfaces exactly the "wait, can our endpoint actually do that" questions that otherwise surface during a sprint, not a design review.
If you're mapping this against real user needs rather than just the endpoint shape, pairing it with a customer journey exercise helps confirm whether users actually want to jump to page 40, or whether infinite scroll matches how they naturally browse — the two questions compound, since a screen that promises the wrong pagination pattern for how users actually search is a jobs-to-be-done mismatch as much as a technical one.
Key Takeaways
- APIs paginate because unbounded responses are slow, expensive, and eventually unusable — database cost, payload size, and client render cost all push toward returning data in bounded chunks.
- Offset pagination (
page,limit) is simple and supports jumping to any page, but degrades on large datasets and breaks (duplicates/gaps) when rows change between requests. - Cursor pagination (
after=<token>) stays stable and performant on large or fast-changing datasets, but can't jump to an arbitrary page and usually can't cheaply report a total count. - The pagination style an API exposes dictates the UX pattern a screen can support — numbered pages need offset, infinite scroll pairs naturally with cursor, and swapping later usually means renegotiating the backend contract.
- Filtering and sorting parameters must be designed into the endpoint before a screen can offer that control — a filter in a wireframe with no matching query parameter is a mockup, not a feature.
- Filters and pagination have to compose correctly — a cursor issued under one filter set isn't valid once filters change, a frequent source of late-stage "pagination broke" bugs.
- Sorting by an unindexed field can be dramatically slower at scale, even though it's invisible in small test datasets.
Frequently Asked Questions
What's the difference between offset and cursor pagination?
Offset pagination requests a page number and size (page=3&limit=20) and supports jumping to any page directly. Cursor pagination requests everything "after" an opaque pointer to a specific row (after=xyz), trading jump-to-page ability for stability on datasets that change frequently between requests.
Which pagination style should I use for an infinite-scroll feed?
Cursor pagination is the better fit for infinite scroll, because the client only ever needs to ask "what comes next," which stays correct even as new items are inserted while the user scrolls. Offset pagination can work for infinite scroll too, but risks visible duplicates or gaps if the underlying data changes often.
Why did my filter break pagination in production?
Most commonly, a pagination cursor or offset issued for one filter set was reused after the filter changed, so "page 2" silently meant a different subset than intended. The fix is ensuring the API either invalidates old cursors when filters change or the client refetches from the start whenever a filter parameter changes.
Do I need pagination if my dataset is small?
Not urgently, but designing the API without any pagination parameters at all tends to get load-bearing fast, since every screen that lists the data ends up assuming an unbounded response. It's cheaper to add basic limit/offset or cursor support before a small dataset becomes a large one than to retrofit it once every client depends on the full response.
Can users sort by any field in a list API?
Technically often yes, but sorting by a field without a database index can be significantly slower than sorting by an indexed one, and that gap only becomes visible once the dataset is large. Treat "let users sort by column X" as a requirement to confirm with engineering whether X is indexed, not just a front-end toggle.