Pagination

In this guide, we will look at how to work with paginated responses when querying the Selectify API. By default, all responses limit results to ten. However, you can go as high as 100 by adding a limit parameter to your requests. If you are using one of the official Selectify API client libraries, you don't need to worry about pagination, as it's taken care of internally.

When an API response returns a list of objects, pagination is supported. In paginated responses, objects will be formatted as a Search payload that contains your data in the items key. The other variables are used to paginate through the response endpoint to get more data.

Example

In this example, we request elements from 11 to 30 back from the server.

  • Name
    skip
    Type
    integer
    Description

    The amount of objects to skip. Assuming the default limit, passing skip=0 would display items 1-10, 10 corresponds to items 11-20, etc. It's recommended to skip by your limit while iterating to most performantly fetch new content.

  • Name
    limit
    Type
    integer
    Description

    Limit the number of items returned.

Manual pagination using cURL

curl -G https://api.selectify.aiproject \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d skip=10 \
  -d limit=20

Paginated response

{
  "count": 50,
  "limit": 20,
  "skip": 10,
  "items": [
    {
      "id": "100",
      // ...
    },
    {
      "id": "101"
      // ...
    },
    {
      "id": "102"
      // ...
    }
  ]
}