Skip to main content

Pagination

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

ParameterTypeDefaultRangeDescription
limitnumber501–100Maximum number of items to return per page
offsetnumber00+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
    }
  }
}
FieldDescription
totalTotal number of items matching the query
limitThe limit that was applied
offsetThe 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.