List endpoints in the Operate API return paginated results. Use the limit and offset query parameters to control which slice of data you receive.
Parameters
| Parameter | Type | Default | Range | Description |
|---|
limit | number | 50 | 1–100 | Maximum number of items to return per page |
offset | number | 0 | 0+ | Number of items to skip before returning results |
Example
Fetch the second page of 25 companies:
curl -X GET "https://api.operate.so/companies/list?limit=25&offset=25" \
-H "x-api-key: your-api-key-here"
Response shape
Every paginated response includes a pagination object alongside the data:
{
"success": true,
"data": {
"companies": [...],
"pagination": {
"total": 73,
"limit": 25,
"offset": 25
}
}
}
| Field | Description |
|---|
total | Total number of items matching the query |
limit | The limit that was applied |
offset | The offset that was applied |
Iterating through all pages
To fetch all items, increment offset by limit until you’ve retrieved total items:
let offset = 0;
const limit = 50;
let allCompanies = [];
while (true) {
const response = await fetch(
`https://api.operate.so/companies/list?limit=${limit}&offset=${offset}`,
{ headers: { "x-api-key": apiKey } },
);
const { data } = await response.json();
allCompanies.push(...data.companies);
if (allCompanies.length >= data.pagination.total) break;
offset += limit;
}
Keep limit at 50 or below for optimal performance. The maximum allowed value
is 100.