Pagination
Some endpoints return long lists, so they send them one page at a time. There are two systems, depending on the endpoint.
| Endpoints | System |
|---|---|
| Read results, Bulk search files | sorts array (below) |
| Find people, Find companies | pagination.token, explained on their pages |
The sorts array
First page
Send the number of items you want with limit:
{
"mode": "bulk",
"limit": 30
}
The response contains the total number of items and a sorts array. Keep sorts: it's your bookmark.
{
"success": true,
"items": ["…30 items…"],
"total": 1000,
"sorts": [[1709218821000, "xxxx"], [1709218700000, "yyyy"]]
}
Next pages
Send the same request again, adding next: true and the sorts you received:
{
"mode": "bulk",
"limit": 30,
"next": true,
"sorts": [[1709218821000, "xxxx"], [1709218700000, "yyyy"]]
}
Use next: false to go back one page instead.
Each response gives you a new sorts: always use the latest one. Stop when a page comes back empty.