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

ParameterDescription
pageCurrent page to retrieve.

Default: 1
page_sizeMaximum number of items to retrieve per page.

Default: 10

Maximum: 100

Page/count pagination response format

Meta AttributeDescription
total_countTotal number of results across all pages for the query.
page_sizeThe number of items per page returned.
page_countThe 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.
pageThis 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

ParameterDescription
LimitMaximum number of items to retrieve.

Default: 10

Maximum: 100
OffsetWhere 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 AttributeDescription
total_countTotal number of results across all pages for the query.

This is the same regardless of what type of pagination you use.
limitLimit as requested in the request parameters.
offsetOffset as requested in the request parameters.