Pagination
All list endpoints in the Scalar API use limit/offset pagination to manage large result sets.
Parameters
You can control pagination using the following query parameters:
| Parameter | Type | Default | Max | Description |
|---|---|---|---|---|
limit | integer | 20 | 100 | Number of results to return per page. |
offset | integer | 0 | - | Number of results to skip. |
If you provide invalid values (e.g. limit=abc), the API will fall back to the default values.
Response shape
List responses follow a consistent structure:
{
"results": [...],
"count": 150
}
- results: An array containing the resource objects for the current page.
- count: The total number of resources matching your query across all pages.
Example
Fetching the first page
curl -sS \
-H 'Authorization: Api-Key scalar*live*...' \
'https://<your-host>/api/v1/ideas/?limit=20&offset=0'
Fetching the next page
To fetch the next page, set the offset to the number of results you've already received.
curl -sS \
-H 'Authorization: Api-Key scalar*live*...' \
'https://<your-host>/api/v1/ideas/?limit=20&offset=20'
Best practices
- Default to 20: Start with a limit of 20 results per page unless you have a specific reason to fetch more.
- Clamped values: The
limitis automatically clamped between 1 and 100. - Sequential fetching: If you need to fetch all data, loop through pages until
offset + limit >= count.
