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'bash
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
}json
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'bash
When to stop
Stop paginating when:
next_pageisnull— you've reached the end- You've collected enough results for your use case
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 |