Skip to main content
What you’ll build:
  • Fetch a wallet’s total value, 24h change, and chain breakdown
  • List token holdings with prices and handle pagination
  • Aggregate portfolio value across multiple wallets
  • Fetch balance charts to visualize value over time
Time: ~15 minutes

Prerequisites

  • A Zerion API key (get one here)
  • One or more wallet addresses to track
  • Node.js 18+ (for native fetch)

Steps

1

Get a wallet's portfolio summary

A single call to the portfolio endpoint returns the wallet’s total value, chain distribution, and 24h change.
The response includes:
2

List token holdings

Fetch individual positions sorted by value. Use filter[trash]=only_non_trash to exclude spam tokens.
Key parameters: sort=value (highest value first), filter[positions]=only_simple (wallet tokens only, excludes DeFi), filter[trash]=only_non_trash (excludes spam). Use filter[fungible_ids]=eth,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 to query specific tokens only.
Handling pagination: If a wallet holds many tokens, use links.next to fetch all pages:
3

Aggregate multiple wallets

Fetch portfolio summaries for each wallet and combine them into a single view.
The full working example below also merges the per-chain breakdowns from each wallet to compare value across chains.
4

Fetch balance charts

Use the balance chart endpoint to visualize how portfolio value has changed over time. The period is part of the URL path. Supported periods: day, week, month, 3months, 6months, year, 5years, max.
The response contains data.attributes.points, an array of [timestamp, value] pairs where:
  • timestamp - Unix timestamp (seconds)
  • value - portfolio value at that point in USD
5

Full working example

Save as multi-wallet-tracker.mjs and run with node multi-wallet-tracker.mjs:

Next steps

  • Add DeFi positions to include staked and deposited assets in the totals
  • Track PnL and cost basis per wallet for tax reporting
  • Set up webhooks to update the dashboard in real time when any tracked wallet transacts