Pagination
The CompanyData API uses pagination to return large result sets efficiently. Search and export support standard pagination; export additionally supports scroll pagination for unlimited records.
Standard Pagination
Both /api/company/search and /api/company/export support standard pagination using:
page: The page number to retrieve. Defaults to1if not provided.pageSize: The number of records to return per page.
Search Endpoint (/api/company/search)
- Defaults to
25records per page - Maximum
pageSizeis50 - Maximum total records retrievable:
50
Export Endpoint (/api/company/export)
- Defaults to
25records per page - Recommended
pageSize: 100-1000 - Maximum total records retrievable:
10,000with standard pagination
Scroll Pagination (Export Endpoint Only)
The /api/company/export endpoint also supports scroll pagination for unlimited record retrieval:
useScroll=true: Enable scroll pagination modescrollId: Usemeta.scrollIdfrom the previous response for subsequent requests- Unlimited records: No maximum record limit
- Time-limited: Scroll context expires after 8 minutes
For detailed information and examples, see the Company Export documentation.
Response Structure
Standard pagination returns records under data.records and page details under meta:
{
"meta": {
"totalCount": 1250,
"currentPage": 1,
"totalPages": 50,
"pageSize": 25
},
"data": {
"records": [ /* company objects */ ]
}
}
Scroll pagination uses the same envelope; meta carries the scroll cursor instead of page numbers, and no total count is available:
{
"meta": {
"pageSize": 1000,
"hasMoreRecords": true,
"scrollId": "abc123xyz456",
"recordCount": 1000
},
"data": {
"records": [ /* company objects */ ]
}
}
How Standard Pagination Works
-
Calculation of
from: Thefromparameter is calculated as(page - 1) * pageSize. This determines the starting point of the records to be retrieved for the specified page. -
Total Count and Pages:
-
The total number of records (
meta.totalCount) is determined from the search query results. -
The total number of pages (
meta.totalPages) is calculated by dividingmeta.totalCountbymeta.pageSizeand rounding up.
Example Request
To request the second page of results with 10 records per page:
curl -G https://app.companydata.com/api/company/search \
-H "x-api-key: {ApiKey}" \
-d "page=2&pageSize=10"