Pagination

How to navigate between pages of data received from Fera APIs.

Fera allows 2 types of pagination:

  • Page/count pagination
  • Limit/offset pagination

In both cases the response will return pagination data in the meta attribute of the response and the results in the data attribute.

Page/Count Pagination (default)

To use page/count pagination simply include the page parameter with your list request like this:

<https://api.fera.ai/v3/reviews.json?page=1>

You'll get a response that looks like this:

{
  data: [],
  meta: {
    total_count: 123,
    page_size: 10,
    page_count: 13,
    page: 1  
  }
}

Page/count request attributes

Parameter

Description

page

Current page to retrieve.

Default: 1

page_size

Maximum number of items to retrieve per page.

Default: 10

Maximum: 100

Page/count pagination response format

Meta Attribute

Description

total_count

Total number of results across all pages for the query.

page_size

The number of items per page returned.

page_count

The total number of pages of data that exist.

You can calculate this yourself if you want (but we wanted to make it easy for you).

This value returns 0 if there are 0 results in the query.

page

This is the current page you're on.

Limit/offset pagination

To use offset/limit style pagination just include limit or offset in your parameters like this:

<https://api.fera.ai/v3/reviews.json?limit=5&offset=10>

You'll get a response that looks like this:

{
  data: [],
  meta: {
    total_count: 123,
    limit: 5,
    offset: 10
  }
}

Limit/offset request attributes

Parameter

Description

Limit

Maximum number of items to retrieve.

Default: 10

Maximum: 100

Offset

Where to start the result cursor at.

If there are 100 results and the offset is set to 10, you'll receive items 11..20 (assuming limit of 10).

Default: 0

Limit/offset response attributes

Meta Attribute

Description

total_count

Total number of results across all pages for the query.

This is the same regardless of what type of pagination you use.

limit

Limit as requested in the request parameters.

offset

Offset as requested in the request parameters.