Setting maximum pagination limit in queries

Several API calls allow setting a pagination limit to the number of results that are returned. Changing the default pagination limit (50) to its allowed maximum value (100) cuts the number of required API calls in half when iterating over the entire result set of a query.

Pagination limits can be set for various API calls, but we recommend that you set it for the following queries as they tend to return the largest result sets:

  • api.files.query()
  • api.projects.query()
  • api.tasks.query()
  • task.get_batch_children()

Not optimized for rate limit

Here is an example for a project query that uses the default pagination limit of 50.

for project in api.projects.query().all():

Optimized for rate limit

In the example below, the limit is set to its allowed maximum value of 100.

for project in api.projects.query(limit=100).all():