Briefle words · Code & architecture
Pagination
Splitting a long list into pages so an API returns a small, fixed number of records at a time.
Say it to an AI
GET /v1/videos/:id/comments with cursor-based pagination: default limit 20, max 100, newest first. Return {data, pagination: {limit, nextCursor, hasMore}} and accept ?cursor= for the next page. Never an unbounded query.
How an expert would brief the stronger version of “Video comments API”.
See it
Try it as a puzzle →A video app loads the comments under a popular video from its API.
Why: B's request asks for ?limit=20 and gets 20 comments; A's request has no limit and returns 48,213.
Related words
Room 5 · APIs & data
Learn “Pagination” in a five-minute lesson