Skip to main content
When an API response contains more results than can be returned at once, use pagination to retrieve all pages of data.

How pagination works

  1. Make your initial request with max_results
  2. Check the response for a next_token in the meta object
  3. If present, make another request with that token as pagination_token
  4. Repeat until no next_token is returned

Pagination tokens


Response structure

When there are no more results, next_token is omitted:

Pagination parameters

Check each endpoint’s API reference for specific max_results limits.

Example: Paginating through all results


Best practices

Use max results

Request the maximum allowed max_results to minimize API calls.

Handle partial pages

The last page may have fewer results than max_results.

Store tokens

Save next_token if you need to resume pagination later.

Don't poll with pagination

For new data, use since_id instead of paginating repeatedly.

Result ordering

Results are returned in reverse chronological order:
  • First result on first page = most recent
  • Last result on last page = oldest
This applies within and across pages.

Notes

  • Pagination tokens are opaque strings—don’t parse or modify them
  • Tokens may expire after some time
  • If you get fewer results than max_results, more may still exist (continue until no next_token)
  • Use SDKs for automatic pagination handling

Next steps

Rate limits

Understand request limits when paginating.

SDKs

Libraries with built-in pagination.