Skip to main content

Pagination

The Companies Search endpoint (GET /api/companies/search) returns paginated results.

Parameters

ParameterTypeDefaultDescription
pageinteger1Page number (1-indexed)
limitinteger20Items per page (max 100)

Response Format

{
"results": [...],
"pagination": {
"page": 1,
"limit": 20,
"total": 156,
"totalPages": 8
}
}

Example

curl "https://api.veraenrich.com/companies/search?q=fintech&page=1&limit=20" \
-H "Authorization: Bearer $VERA_API_KEY"

Iterating All Pages

async function processAllCompanies(query, processFunc) {
let page = 1;

while (true) {
const response = await fetch(
`https://api.veraenrich.com/companies/search?q=${query}&page=${page}&limit=100`,
{ headers: { 'Authorization': `Bearer ${process.env.VERA_API_KEY}` } }
);

const { results, pagination } = await response.json();

for (const company of results) {
await processFunc(company);
}

if (page >= pagination.totalPages) break;
page++;
await new Promise(r => setTimeout(r, 100)); // Rate limit courtesy
}
}

Best Practices

Use CaseRecommended limit
User-facing UI10-25
Data tables25-50
Batch processing100