All queries that retrieve a list of records are paginated. The parameters for controlling pagination are
By default, we limit results to 50 per page. If you need to increase or decrease this amount, use the
limit parameter as shown in the example below.
# This will set the number of entities by page to 20 instead of 50. curl --request GET \ --url https://api.katanamrp.com/v1/products?limit=20 \ --header 'Content-Type: application/json' --header 'Authorization:Bearer <API key>'
You cannot request more than 250 records at a time. If you raise the limit above this amount, we will automatically change the limit to 250.
We set the limit at 250 because this is a good trade-off between memory consumption and performance (on the server-side).
To paginate results, we use the offset method. The page query parameter indicates the requested page number. By default, this query parameter is equal to 1.
In order to provide a better experience, we provide pagination metadata in response headers, such as
last_page. They are useful indicators for requesting the previous or next pages.
# This will return the second page of records, the records being paginated by 20. curl --request GET \ --url https://api.katanamrp.com/v1/products?limit=20&page=2 \ --header 'Content-Type: application/json' --header 'Authorization:Bearer <API key>'
All pagination metadata is saved as an object to the
X-Pagination header. The response contains the following structure, whether items are returned or not:
Total number of records in the result set matching the filters.
Number of pages in the result set.
The offset from 0 for the start of this page.
The indication of the page number being requested
The indication if the request page is the first one in the collection.
The indication if the request page is the last one in the collection.