Skip to main content

How it works

List endpoints return one page at a time, newest first, under a plural key such as posts, with two extra fields:
Two query parameters control paging: A limit outside 1 to 100, or a malformed cursor, returns 400 with type invalid_request.

Cursors

  • Treat a cursor as an opaque string. Do not build, parse or edit one.
  • A cursor marks a position, not an offset, so items added while you page never shift the results or cause duplicates.
  • Cursors do not expire, and a cursor from one endpoint is not meant for another.
  • Keep the same filters (such as search or tab) for every page of one listing. limit can change between pages.

Paginated endpoints

These lists return everything in one response and have no paging fields: GET /discover (up to 50 random posts), GET /posts/{code}/comments (at most 500 comments) and GET /sessions.

Short pages

A page can hold fewer than limit items while has_more is still true. This happens when items are filtered after the page is read: GET /gifs with a narrow search, follower lists that skip suspended users, and notifications that group several events into one entry. Always loop on has_more, never on the page length.

Fetching every page