Channel Pagination
Confused about "Channel Pagination"?
Let us know how we can improve our documentation:
The channel query endpoint allows you to paginate the list of messages, watchers, and members for one channel. To make sure that you are able to retrieve a consistent list of messages, pagination does not work with simple offset/limit parameters but instead, it relies on passing the ID of the messages from the previous page.
For example: say that you fetched the first 100 messages from a channel and want to load the next 100. To do this you need to make a channel query request and pass the ID of the oldest message if you are paginating in descending order or the ID of the newest message if paginating in ascending order.
Use the id_lt
parameter to retrieve messages older than the provided ID and id_gt
to retrieve messages newer than the provided ID.
The terms id_lt
and id_gt
stand for ID less than and ID greater than.
ID-based pagination improves performance and prevents issues related to the list of messages changing while you’re paginating. If needed, you can also use the inclusive versions of those two parameters: id_lte
and id_gte
.
For members and watchers, we use limit
and offset
parameters. The maximum limit and offset that can be used is 300
and 10000
, respectively.