Pagination and Search Results
How to paginate through search results and handle large result sets.
The Search endpoints (Person Search, Company Search) return paginated results. Here's how to work with them.
How pagination works
Search results are returned in pages. Each response includes a next_page token that you pass in subsequent requests.
# First page
curl -G \
-H "Authorization: Bearer YOUR_API_KEY" \
'https://enrichlayer.com/api/v2/search/person' \
--data-urlencode 'current_role_title=CTO' \
--data-urlencode 'country=US' \
--data-urlencode 'page_size=10'The response includes:
{
"results": [...],
"next_page": "https://enrichlayer.com/api/v2/search/person?country=US&page_size=10&next_token=30U9cV4q1Nz...truncated",
"total_result_count": 1542
}Getting the next page
Pass the next_page as the next request url:
curl -G \
-H "Authorization: Bearer YOUR_API_KEY" \
'https://enrichlayer.com/api/v2/search/person?country=US&page_size=10&next_token=30U9cV4q1Nz...truncated'When to stop
Stop paginating when:
next_pageisnull— you've reached the end- You've collected enough results for your use case
Result ordering and incremental fetching
New and recently updated profiles appear toward the beginning of the result set, not at the end. The result order can shift between sessions as new data is ingested.
Fetching only new profiles across sessions
To collect only profiles you haven't seen before, without relying on public_identifier_not_in_list:
- Start a fresh sweep from page 1
- Stop as soon as you encounter a profile you already have on record
Everything before that point is new since your last run.
Note: Re-calling a next_page URL after it returns null will not return newly added profiles. The cursor is designed for resuming within a single sweep, not for cross-session incremental fetching.
Credit costs
Each search page costs credits. Credits are charged per search result, not per search request.
| Page size | Credit cost |
|---|---|
| 1 | 3 |
| 10 | 30 |