- Page-based (default): request pages by number. Supported by all list endpoints.
- Cursor-based: follow a cursor from one page to the next. Supported by
/api/v1/samples,/api/v1/samples/public, and/api/v1/metadata. Recommended when fetching large numbers of samples or metadata records.
Page-based pagination
Page-based pagination follows the basic model of the GitHub API. Pages may be requested using thepage and per_page query string arguments:
The
Link header lists links to the current (self), next, and last pages. The X-Total-Count header contains a count of the total number of items:
The
next link is included on every page, including the last one. Use the last link or X-Total-Count to tell when you have reached the end.Cursor-based pagination
To use cursor-based pagination, send theX-Pagination-Style: cursor request header. Pages are then requested using the cursor and per_page query string arguments:
Each response includes an
X-Next-Cursor header if more results are available. Pass its value as cursor to fetch the next page. The last page has no X-Next-Cursor header. Cursor-based responses do not include the Link or X-Total-Count headers.
The
page and cursor arguments cannot be combined. Sending page with the X-Pagination-Style: cursor header, or cursor without it, returns a 400 Bad Request.sort and where arguments for every page.
Example
Fetch the first page of samples, most recent first:sort:
X-Next-Cursor header:

