Skip to main content

Overview

Every list endpoint in the Parallel AI API uses page-based pagination. You control which page of results to return and how many items appear per page using two query parameters:

Paginated Response Format

All paginated responses include the result items alongside metadata to help you navigate through the full dataset:

Example Request

Fetch the second page of agents, with 20 items per page:

Example Response

Use hasNext rather than comparing page to pages to determine whether to continue — it accounts for edge cases where the total changes between requests.

Fetching All Pages

To retrieve all items across every page, loop until hasNext is false. The example below uses pageSize=100 to minimise the number of requests:
Set pageSize to 100 (the maximum) when fetching all pages to minimise the total number of API requests and reduce latency.

Tips for Large Datasets

Use any available filter parameters (e.g. status, search, date ranges) to narrow the result set before paginating. Fewer total items means fewer pages to traverse and faster response times.
If you’re iterating through many pages in a tight loop, add a short delay between requests and implement retry logic for 429 Too Many Requests responses. See Errors for a retry example.
The total and pages fields are useful for displaying progress indicators or estimating job duration. Cache them from the first response rather than re-fetching metadata on every page.