Pagination
REST API endpoints that potentially may return an unlimited number of items are paginated.
Requests
In addition to the endpoint-specific parameters, endpoints that return paginated responses accept the following pagination parameters to control the page and number of items per page correspondingly:
page
int
1
Page number
page_size
int
10
Number of items per page
The maximum number of items per page is 250
.
Responses
Paginated responses contain two additional properties providing information on the total number of items and the total number of pages:
item_count
int
Total number of items
page_count
int
Total number of pages
Example
Get the second page of accounts with 25
items per page:
Traversing results
When making an API request to an endpoint that returns paginated data, you usually don't receive all of the results in a single response. To traverse the data, you need to increment the page number in your requests until you collect all the required items. When doing so, note the rate limits. Setting the number of items per page to its maximum value of 250
will minimize the chances of being rate-limited for most of the use cases.
Note that if new objects are added to the list of items being paginated, the contents of each page will change.
Last updated