Pagination & Sorting
Learn how to paginate and sort the data.
Not every endpoint supports pagination and sorting.
Pagination
Pagination can be used to limit the number of results returned by an API request. This is useful for reducing the amount of data that needs to be transferred over the network, and for reducing the amount of data that needs to be processed by the client.
You can use the limit and offset query parameters to paginate through the results of an API request. The limit parameter specifies the number of results to return, and the offset parameter specifies the number of results to skip. For example, if you wanted to get the first 10 results, you would set limit to 10 and offset to 0. If you wanted to get the next 10 results, you would set limit to 10 and offset to 10.
| Prop | Type | Default |
|---|---|---|
limit | integer | 100 |
offset | integer | 0 |
Sorting
You can use the sort and sortOrder query parameters to sort the results of an API request. The sort parameter specifies the field to sort by, and the sortOrder parameter specifies the sort order (ascending or descending). For example, if you wanted to sort the results by the name field in ascending order, you would set sort to name and sortOrder to asc.
The sort parameter supports any of the fields of the model being queried.
The sortOrder parameter supports asc (ascending) or desc (descending). This field is optional, and defaults to
desc if not otherwise specified.
| Prop | Type | Default |
|---|---|---|
sort | string | - |
sortOrder | string | desc |