Pagination and Sorting

Our API adheres to the JSON:API specification, providing a consistent approach to both pagination and sorting across endpoints.

Pagination

To paginate your API requests, include a page object with the following parameters:

Example Request:

GET /api/articles?page[number]=2&page[size]=50

This request returns the second page of articles with 50 items per page.

Sorting

We support a straightforward sorting mechanism via the sort parameter. Simply pass a comma-separated list of column names to sort by. To sort a column in descending order, prefix its name with a minus (-) sign. Columns without a prefix will be sorted in ascending order.

Example Request:

GET /api/articles?sort=-created_at,title

In this example:

By combining these parameters, you can efficiently tailor your API queries to suit your data retrieval needs.