{"data":{"id":125,"slug":"cursor-vs-offset-pagination-part-7-125","title":"Cursor vs offset pagination, part 7","excerpt":"This is part 7 of our series, and this time we focus on edge cases readers asked about. Offset pagination asks for 'items 40 to 60'. Cursor pagination asks for 'the next page after this marker'. The…","seriesName":"Cursor vs offset pagination","seriesPart":7,"sections":[{"heading":"Introduction","paragraphs":["This is part 7 of our series, and this time we focus on edge cases readers asked about. Offset pagination asks for 'items 40 to 60'. Cursor pagination asks for 'the next page after this marker'. The difference matters as soon as the underlying data changes while you are reading it."]},{"heading":"Common pitfalls","paragraphs":["Be careful with relative URLs. Resolve every link against the page it came from, not against the site root, or you will request pages that do not exist.","Time zones matter more than they seem. Store timestamps in UTC and convert only when displaying them."]},{"heading":"Going further","paragraphs":["Read the site's terms of service before you start. Many sites welcome automated access within limits and say so explicitly; others ask you to use an API instead.","Pagination comes in several shapes: numbered pages, next links, offsets and opaque cursors. Each has trade-offs, and a robust scraper should detect the end of the result set rather than assuming a fixed number of pages."]},{"heading":"Key takeaway","paragraphs":["Use cursors when the API offers them, treat them as opaque strings, and stop when the API returns no next cursor rather than when a page is short."]}],"authorId":4,"authorName":"Lucas Silva","authorSlug":"lucas-silva","category":"APIs","tags":["ethics","playwright","javascript","python"],"publishedAt":"2026-03-25T00:00:00.000Z","wordCount":188,"readingTimeMinutes":2}}