Pagination
How to use pagination on our API.
This guide will show you how to use pagination on our API.
If not specified, all response return 10
elements but you can go as high as 1000
by using the size
parameter.
Response
data*
object[]Contains the list of documents returned by the request.
size*
integerExample: 3Number of records per page requested.
has_next*
integerExample: truetrue
if there are more records available.count*
integerExample: 2Number of records returned in the current page.
search_after*
string | nullExample: "2"The cursor to use to get the next page of results.
Note: This value is not always equals to theid
of the last document.total
numberExample: 51Some routes return the total number of elements.
See the documentation of the route for more information.
{
"data": [
{
"id": "1",
},
{
"id": "2",
}
],
"size": 2,
"has_next": true,
"count": 2,
"search_after": "2",
"total": 51
}
Request a specific page
To use the pagination, most of the time you'll use the search_after
parameter.
But sometimes you need to display the results on a table and you might want to ask for the nth page directly.
On some routes this usecase is possible
In these routes you can use the page
parameter to get the nth page directly.
Notes:
- The
page
parameter is 1-based, so the first page ispage=1
. - Using the
page
parameter you can't use thesearch_after
parameter. - You can't request a window of more than
10,000
documents (size
*page
). If you want more results, use thesearch_after
parameter instead.