Indexing / Data·EVM · Solana · Multi-chain
Zerion API
Wallet portfolio API powering token balances, NFT positions, DeFi positions across 8,000+ protocols, transactions, and PnL across 38+ blockchains (EVM + Solana) in a single REST call with sub-second latency.
- 01wallet dashboards with DeFi position decoding
- 02multi-chain portfolio aggregation
- 03PnL and historical balance charts
- 04NFT portfolio with floor prices
- 05transaction feeds with human-readable summaries
- pnpm add axios
| Variable | Scope | Description |
|---|---|---|
| ZERION_API_KEY | Server | Zerion API key from developers.zerion.io. Sent as HTTP Basic auth (the key as the username, empty password) — `Authorization: Basic ${base64(key + ':')}`. Server-side only. |
Use the Zerion REST API from a server route with HTTP Basic auth (API key as the username, empty password). Base URL: `https://api.zerion.io/v1`. Common calls: `GET /wallets/{address}/portfolio?currency=usd` (cross-chain portfolio summary), `GET /wallets/{address}/positions/?filter[chain_ids]=ethereum,base¤cy=usd` (DeFi + token positions), `GET /wallets/{address}/transactions/?filter[chain_ids]=ethereum&page[size]=50` (decoded tx feed), `GET /wallets/{address}/nfts/positions/`, `GET /wallets/{address}/charts/{period}?currency=usd` (balance chart, period in [hour, day, week, month, year, max]). Responses follow JSON:API spec — read `data`, `included`, and `meta` blocks. Pass `X-Env: testnet` to query testnets.
- ⚑Authentication is HTTP Basic with the API key as the username — NOT a bearer token; many AI-generated examples wrongly use `Authorization: Bearer`.
- ⚑Free dev tier has tight RPS limits and monthly cap; production wallet pages with refresh-on-focus will 429 without server-side caching (suggest 30–60s TTL per address).
- ⚑Solana support is live but lacks DeFi protocol position decoding — for Solana wallets you get balances and NFTs, not Marinade/Kamino/Drift positions like on EVM; surface this gap in UI.
- ⚑Chain coverage is 38+ chains — Bitcoin, Cosmos, Sui, Aptos, TON are NOT supported; verify chain at developers.zerion.io/reference/chains before committing.
- ⚑Indexing latency to chain head is sub-second for prices/balances but DeFi position decoding can lag 10–60s after a deposit; show a 'Refreshing...' state and retry.
- ⚑Schema drift: JSON:API `included` array shape changes when relationships are added — destructure defensively and pin to a stable response shape via `Accept` versioning where supported.