REST API Pagination, Filtering, Sorting, and Search

Common collection query patterns including offset pagination, cursor pagination, filtering, sorting, and search.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Pagination patterns
Offset pagination
GET /users?page=2&limit=25

# Simple page and limit contract.

Cursor pagination
GET /events?limit=100&cursor=eyJpZCI6IjEwMDAifQ==

# Use opaque cursors for large or changing datasets.

Return next-page metadata
{
  "data": [/* ... */],
  "page": 2,
  "limit": 25,
  "total": 140,
  "next_cursor": null
}

# Expose pagination state in the response body.

Use a stable sort key with cursors
GET /events?sort=created_at:desc&cursor=...

# Paginate in a deterministic order.

Recommended next

No recommendations yet.