Pagination
Understanding and working with pagination
We’ve added pagination to some of the routes which might return a lot of data:
GET /v1/entities
(without?entityId
query param will return all entities belonging to the calling developer)GET /v1/transactions
will return all transactions for a given entityGET /v1/transactions/counterparties
will return all the counterparties in the transaction history of a given entity
These requests without pagination now have an upper bound on the number of records they will return. If not all records are returned, the return body will include hasMore
as true
, and nextCursor
, representing the last entity returned in the payload.
Using Pagination
To use the pagination, there are two query parameters:
Example
Here’s an example of how to use pagination with the entities endpoint:
Response:
To get the next page, make a request using the nextCursor
value:
Best Practices
Select a pageSize
that balances your needs for data completeness with API performance. Larger page sizes mean fewer requests but more data per request.
Always check the hasMore
flag to determine if you need to make additional requests to get all the data.
Save the nextCursor
value from each response to use in subsequent requests.
Implement proper error handling for cases where the cursor might be invalid or expired.
Example Implementation
Here’s a complete example of how to fetch all entities using pagination: