Skip to main content
Most Zerion API list endpoints return paginated results and support filtering. This page covers the patterns you’ll use across the API.

Pagination

List endpoints use cursor-based pagination. Each response includes a links object with URLs for navigating between pages.

How it works

  1. Make your initial request without any page parameter
  2. Check links.next in the response — if present, there are more results
  3. Follow the links.next URL directly to get the next page
  4. Repeat until links.next is absent
Response with pagination
{
  "links": {
    "self": "https://api.zerion.io/v1/wallets/0x.../positions/?page[size]=10",
    "next": "https://api.zerion.io/v1/wallets/0x.../positions/?page[size]=10&page[after]=eyJhZnR..."
  },
  "data": [...]
}
Control the number of results per page with page[size]:
ParameterTypeDefaultMinMax
page[size]integer1001100
Do not construct page[after] cursor values manually. Always use the full URL from links.next — cursor tokens are opaque and may change format without notice.

Iterating through all pages

async function fetchAll(url, apiKey) {
  const results = [];

  while (url) {
    const response = await fetch(url, {
      headers: { Authorization: `Basic ${btoa(`${apiKey}:`)}` }
    });
    const json = await response.json();
    results.push(...json.data);
    url = json.links.next || null;
  }

  return results;
}

const positions = await fetchAll(
  "https://api.zerion.io/v1/wallets/0x.../positions/?page[size]=100",
  "YOUR_API_KEY"
);

Filtering

Filter parameters use the filter[field] syntax. Pass multiple values as comma-separated:
?filter[chain_ids]=ethereum,base&filter[position_types]=deposit,staked
Common filters include chain_ids, position_types, operation_types, trash, search_query, and fungible_ids. Each endpoint documents its available filters and accepted values in the relevant API reference page, such as wallet positions, wallet transactions, or fungibles search. For spam filtering behavior, see the spam filtering guide.

Sorting

Some endpoints support a sort parameter. Prefix with - for descending order:
?sort=-value
Available sort fields vary by endpoint — check the relevant list endpoint in the API reference, such as wallet positions or wallet transactions, for supported options.

Currency

Most endpoints that return monetary values accept a currency parameter. Default is usd.
?currency=eur
Supports major fiat currencies and eth/btc. See any currency-aware endpoint, such as wallet positions, for the full list.