🔌Pagination
Also known as Paging, Cursor Pagination, Offset Pagination
Splitting a long list into pages, so an API sends a few at a time.
Think of it like
Think of it like a book. You read one page at a time, not the whole book on one huge sheet.
Example
Lucy's shop has 50,000 products. Her API sends 20 at a time, and the app asks for the next page as the user scrolls.
Why it matters
Sending 50,000 rows at once is slow for the server and the phone. Pages keep each answer small and fast.
Definition
Example code
url
https://api.example.com/products?page=2&limit=20Common mistake
Key takeaways
- 1A few at a time. One page per request.
- 2Offset or cursor. Two ways to say where.
- 3Cursors stay right. When rows are added.