<< back to Guides

📄 API Pagination – Quick Guide

Pagination helps manage large datasets by splitting results into smaller, manageable chunks.


📌 1. Offset-based Pagination

Uses offset and limit to retrieve pages.

Example:
GET /users?offset=20&limit=10

Pros:


📌 2. Page-based Pagination

Specifies page and size of each page.

Example:
GET /users?page=3&size=10

Pros:


📌 3. Cursor-based Pagination

Uses a unique identifier (cursor) to fetch next results.

Example:
GET /users?cursor=eyJpZCI6MTAw

Pros:


📌 4. Keyset-based Pagination

Paginates using an indexed key like id, created_at.

Example:
GET /users?after_id=100&limit=10

Pros:


📌 5. Time-based Pagination

Uses timestamps to paginate chronologically.

Example:
GET /events?start=2024-01-01T00:00&end=2024-01-02T00:00

Pros:


📌 6. Hybrid Pagination

Combines techniques (e.g., cursor + timestamp).

Example:
GET /logs?cursor=abc123&start_time=2024-01-01

Pros:


✅ Best Practices


<< back to Guides