Pagination
Cheat sheet · https://pcornel.dk/topic.php?topic=5308
Answer
Retrieval of large result sets across multiple responses using page/offset or cursor/token mechanisms.
Remember
- First page complete ≠ dataset complete; APIs may silently enforce default limits.
- Page number stable ≠ dataset stable; inserts/deletes between requests can shift offset-based pages.
- Cursor token ≠ reusable forever; tokens can expire or encode server-side state.
- No next token ≠ no hidden authorization-filtered data; pagination and visibility are separate.
First checks
curl -sS -D - '<api>/v1/items?page=2&per_page=100' | grep -i link— Link header pagination- Cursor/next token loops — completeness
- Stop conditions — no infinite loops
Verify in this order
request page → next link/cursor → … → done
Where it usually breaks
Receiving a page proves only that subset; completeness requires following the API pagination contract to termination.
Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.
Pagination API boundary map
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Caller / request | Environment/version, identity and exact request contract are attributable | Hidden defaults, wrong endpoint/version, leaked or mismatched credentials |
| Server / response | Status, headers, structured body and request ID are interpreted together | Status-only handling, ignored error body, ambiguous async result or unsafe retry |
| State / proof | Write result is reconciled with resource read-back or acceptance test | Response success treated as final target success without verification |
| Troubleshooting | First failed boundary is preserved, changed minimally and retested | Blind retries, credential rotation, replay or payload edits before evidence is captured |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5308