Overview

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*integer

    Number of records per page requested.

    Example: 3
  • has_next*integer

    true if there are more records available.

    Example: true
  • count*integer

    Number of records returned in the current page.

    Example: 2
  • search_after*string | null

    The cursor to use to get the next page of results.
    Note: This value is not always equals to the id of the last document.

    Example: "2"
  • totalnumber

    Some routes return the total number of elements.
    See the documentation of the route for more information.

    Example: 51
Example of a response
{
  "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 is page=1.
  • Using the page parameter you can't use the search_after parameter.
  • You can't request a window of more than 10,000 documents (size * page). If you want more results, use the search_after parameter instead.