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: truetrueif 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 theidof the last document.totalintegerExample: 51Some routes return the total number of elements.
See the documentation of the route for more information.
{
  "data": [
    {
      "id": "1",
    },
    {
      "id": "2",
    }
  ],
  "size": 3,
  "has_next": true,
  "count": 2,
  "search_after": "2",
  "total": 51
}Headers
The pagination information is also available in the following headers:
X-Query-Size*integerExample: 3Number of records per page requested.
Equivalent to thesizeparameter.X-Data-Count*integerExample: 2Number of records returned in the current page.
Equivalent to thecountparameter.X-Total-CountintegerExample: 51Number of records returned in the current page.
Equivalent to thetotalparameter.Link*stringExample: "https://api.textreveal.com/v3/entities?search_after=abc..; rel=next"Link to the next page.
See the Link header for more information.
If thehas_nextparameter isfalse, this header will not be returned.
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 
pageparameter is 1-based, so the first page ispage=1. - Using the 
pageparameter you can't use thesearch_afterparameter. - You can't request a window of more than 
10,000documents (size*page). If you want more results, use thesearch_afterparameter instead.