{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreibzfoujz5z3fjeecvlrm6yn5mw2wnu65vl4oaclpf2bjzgp42zai4",
    "uri": "at://did:plc:5sgu76a53rz3n6unbykmovqy/app.bsky.feed.post/3mlof5zfyysv2"
  },
  "description": "Pagination is the API pattern for splitting a large collection into smaller pages so clients fetch results incrementally. It is one of the universal API design decisions, with consequences for performance, consistency, and the client developer experience.\n\n\nCommon strategies\n\n * Offset / page-number. ?page=3&limit=20. Simple, supports jumping to arbitrary pages, but slow on large tables and unstable under concurrent inserts (a row added during paging causes duplicates or skips).\n * Cursor / keys",
  "path": "/engineering-glossary/pagination-api-response-paging/",
  "publishedAt": "2026-05-12T18:10:14.000Z",
  "site": "https://sahilkapoor.com",
  "tags": [
    "RFC 5988",
    "REST API",
    "GraphQL",
    "HTTP",
    "Idempotency"
  ],
  "textContent": "**Pagination** is the API pattern for splitting a large collection into smaller pages so clients fetch results incrementally. It is one of the universal API design decisions, with consequences for performance, consistency, and the client developer experience.\n\n## Common strategies\n\n  * **Offset / page-number.** `?page=3&limit=20`. Simple, supports jumping to arbitrary pages, but slow on large tables and unstable under concurrent inserts (a row added during paging causes duplicates or skips).\n  * **Cursor / keyset.** `?cursor=eyJ...`. The server returns an opaque cursor identifying the last item on the page; the client passes it back to fetch the next page. Stable under inserts, scales to any table size, but does not support arbitrary jumps.\n  * **Seek / row-value.** `?after_id=5000`. Like cursor, but using a visible field. Simpler, leaks ordering choice.\n  * **Time-based.** `?since=2026-01-01T00:00:00Z`. Common for activity feeds and audit logs.\n\n\n\n## Headers and metadata\n\nAPIs typically return paging metadata either inline (`{ data: [...], next_cursor: \"...\" }`) or in HTTP headers (`Link: <...>; rel=\"next\"`, following RFC 5988). Both work; pick one and stay consistent.\n\nšŸ”—\n\n**Related Terms**\nREST API, GraphQL, HTTP, Idempotency.",
  "title": "Pagination",
  "updatedAt": "2026-05-13T19:15:05.204Z"
}