Docs
Cursor & Pagination
Cursor & Pagination
How to use cursors for pagination in API responses
Understanding Cursors
At the end of the entries array you'll find two objects with the type TimelineTimelineCursor
. There is one cursor to go up (Top) and one for going down (bottom) the list. You just need to provide the value as the cursor parameter to get the next page of the pagination.
Example
{
"data": [...],
"cursors": {
"top": "DAABCgABGNqxkNkKAAIZ2rGBvwoAABnatQ7dCgACGdq1DQ8IAAIZ2rqXFQgAAhnauprOAAA",
"bottom": "DAABCgABGNqxkNkKAAIZ2rGBvwoAABnatQ7dCgACGdq1DQ8IAAIZ2rqXFQgAAhnauprOAAA"
}
}
Usage
To get the next page, use the cursor value in your request:
curl --request GET \
--url 'https://twitter-aio.p.rapidapi.com/endpoint?cursor=DAABCgABGNqxkNkKAAIZ2rGBvwoAABnatQ7dCgACGdq1DQ8IAAIZ2rqXFQgAAhnauprOAAA' \
--header 'X-API-KEY: YOUR_API_KEY'