Pagination
_limit
and _skip
parameters can be used to paginate through the results. For
example, the first three pages for the lead resource (100 records per page) are
given below:
- Page 1:
/api/v1/lead/?_skip=0&_limit=100
- Page 2:
/api/v1/lead/?_skip=100&_limit=100
- Page 3:
/api/v1/lead/?_skip=200&_limit=100
The response contains two fields: data
containing the list of objects and
has_more
, which indicates if you reached the last page.
Additionally, there is a maximum limit that can vary per resource. You will get a 400 response with an appropriate message if you exceed it.
Deep Pagination
If you're planning to iterate through a long list of results (for example, all
leads, contacts, or activities within your organization), doing so using _skip
and _limit
is going to be inefficient at best or outright impossible at worst.
Close API has a maximum _skip
limit which varies per resource.
If you need to paginate for more than a few pages, update your query to return
smaller batches of objects. A popular method to do this is to use the
date_created
field as a range, and make multiple requests while incrementing
or decrementing the date.
Another option for extracting a larger portion of your data out of Close efficiently is to request its export via the Export API.