# Pagination

> Splitting a long list into pages, so an API sends a few at a time.

**Field:** Software Development  
**Category:** APIs  
**Also known as:** Paging, Cursor Pagination, Offset Pagination

## 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.

## Definition

Pagination splits a long list of results into pages. The API then sends a few at a time. The client asks for a page with query parameters, like ?page=2&limit=20. Some APIs use an offset, a count of rows to skip. Others hand back a cursor, a marker that says where the next page starts. Cursors stay correct even when new rows are added while you page.

## 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.

## Example code

```url
https://api.example.com/products?page=2&limit=20
```

Ask for the second page, 20 products long.

## Why it matters

Sending 50,000 rows at once is slow for the server and the phone. Pages keep each answer small and fast.

## Common mistake

Using page numbers on a list that changes fast. New items push old ones down, and users see repeats.

## Three principles

- **A few at a time.** One page per request.
- **Offset or cursor.** Two ways to say where.
- **Cursors stay right.** When rows are added.

## Related terms

- [Query Parameter](https://learn.benibix.com/term/infrastructure/query-parameter)
- [REST API](https://learn.benibix.com/term/development/rest-api)
- [API Endpoint](https://learn.benibix.com/term/development/endpoint)
- [Application Programming Interface (API)](https://learn.benibix.com/term/development/api)

---

Source: https://learn.benibix.com/term/development/pagination
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
