Skip to main content
Many Gero Nexus endpoints return lists of items in pages. This guide explains the pagination parameters and how to iterate through all results.

Pagination Parameters

List endpoints accept two query parameters:
A few endpoints use a different default pageSize (for example, address transaction history defaults to 20). The maximum is always 100. Check the endpoint’s page in the API Reference for its exact defaults and any endpoint-specific filters (some endpoints add their own parameters, e.g. DReps accept a sort).

Request Examples

Detecting the Last Page

Paginated endpoints come in two response shapes — check the endpoint’s API Reference page for which it uses. Neither sends pagination-metadata response headers. Bare array (e.g. /api/blocks, /api/addresses/{address}/utxos). No metadata in the body — keep requesting pages until you receive fewer items than your pageSize (or an empty array). That page is the last one.
Wrapper object (e.g. /api/addresses/{address}/transactions/history). Items are nested under a key, alongside a pagination block — stop when pagination.hasNext is false.

Iterating Through All Pages

The helpers below are for bare-array endpoints (they stop on a short page). For a wrapper endpoint, loop while pagination.hasNext is true — see the wrapper example below.

Bare-array endpoints — JavaScript/TypeScript

Bare-array endpoints — Python

Wrapper endpoints

For a { items, pagination } endpoint, loop while pagination.hasNext:

Best Practices

  • Use smaller pages (20–50) for interactive UIs that need a fast first response
  • Use the maximum (100) for batch processing to minimize round trips
Add a small delay between page requests so a deep backfill doesn’t trip the per-second limit. See Rate Limits.
Cache slow-changing paginated data (block, tx, and asset metadata) to cut request volume against your monthly quota.

Endpoints Supporting Pagination

A representative (non-exhaustive) set of page/pageSize endpoints and their response shape:
Not every list endpoint paginates this way. Some return the full set in one response (e.g. /api/pools), and some use a different cursor instead of page/pageSize (e.g. /api/account/{stakeAddress}/txs takes a required from block-height parameter). Always check the endpoint’s API Reference page for its exact parameters and response shape.

Next Steps

Rate Limits

Understand rate limiting and quotas

Error Handling

Learn how to handle API errors

Authentication

Learn about API authentication

API Reference

Explore all available endpoints