Offset, cursor, and keyset pagination — cursor is most reliable for large frequently-changing datasets.
Pagination Patterns
# Offset pagination (simplest)
GET /posts?page=3&limit=20
{"data":[...],"pagination":{"total":500,"page":3,"pages":25}}
# Cursor pagination (recommended for large data)
GET /posts?limit=20
{"data":[...],"next_cursor":"eyJpZCI6MjB9","has_more":true}
GET /posts?limit=20&cursor=eyJpZCI6MjB9
# Keyset pagination (fastest)
GET /posts?limit=20&after_id=20
# WHERE id > 20 LIMIT 20 (uses index)
# Link headers (RFC 5988)
Link: ; rel="next"