API pagination, filtering and rate limits
Cursor versus offset pagination, honest rate-limit headers, and how to be a polite API client.
List endpoints die first
An API that returns “all customers” works in the demo and times out in year two. Pagination is not optional once a table grows.
Offset vs cursor
- Offset (
?page=4&limit=50) is easy and breaks under inserts (skipped or duplicate rows) and gets slow on large offsets. - Cursor (
?after=id_abc) is stable for infinite scroll and sync jobs. Prefer cursors for anything that incrementally exports data.
Rate limits
Publish a budget (for example 600 requests / minute / key). Return 429 with Retry-After. Clients should back off, not tight-loop. Burst-friendly tokens are kinder than a hard cut.
Filtering
Allow a small set of indexed filters. Do not invent a query language on day one. See database indexes.
Related
Last verified: August 2026. Technology and pricing change — always confirm current details with the vendor.