Wallets API
A wallet's balance of one token at a specific past block
A wallet's balance of ONE token (ERC-20, or SPL mint on SOL) at ONE past block (the slot on SOL) — the token sibling of wallet-balance-at-block. ETH, BNB, BASE, STABLE, SOL.
/api/external/wallet-analysis/wallet-token-balance-at-block/{chain}/{address}What it returns
A wallet's balance of ONE token (an ERC-20 contract, or an SPL mint on SOL), at ONE specific past block — on SOL the block is the slot. balanceRaw is the exact base-unit figure as a decimal string — never pre-divided, and "0" is a real, measured zero, never turned into null. decimals and balance (the exact, arbitrary-precision decimalized figure, also a string) are the token's own on-chain decimals and are null together when that read fails; balanceRaw is still published in that case. A block past the chain's current head at query time is REFUSED with a 400 that states the boundary — it is never answered as a null or a stale value. ETH, BNB, BASE, STABLE and SOL; every other chain returns 400.
Chains
- Solana SOL
- BNB Chain BNB
- Ethereum ETH
- Stable STABLE
- Base BASE
Request
Send your key in the x-dex-data-key header. Replace each <placeholder> with a real value.
curl -H "x-dex-data-key: $DEXDATA_API_KEY" \ "https://api.dexdata.io/api/external/wallet-analysis/wallet-token-balance-at-block/SOL/<address>?token=<token>&block=<block>"
| Parameter | Description |
|---|---|
tokenquery · string · required | The token to read a balance of: an ERC-20 contract address (0x followed by 40 hexadecimal characters), or on SOL an SPL mint address (base58, 32-44 characters). |
blockquery · integer · required | The block number to read the balance at — on SOL, the slot. Must be at least 1, and no greater than the chain's current head at query time — a block past the head returns 400 stating the boundary that was reported. |
chainpath · string · required | The chain the wallet address belongs to. ETH, BNB, BASE, STABLE and SOL — every other chain returns 400. |
addresspath · string · required | The wallet address. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
block | integer | The block number (on SOL, the slot) requested, echoed back. |
token | string | The token address requested, echoed back. |
balanceRaw | string | RAW base units, as a decimal string, at the requested block. "0" is a real, measured zero — this wallet held none of this token at that block, or the block predates the token — and is never turned into null. An address that is not a token on this chain is a 404, never a "0". Never pre-divided by decimals. |
decimals | integer | null | The token's on-chain decimals. null when they could not be read — balanceRaw is still published in that case, and balance is also null. |
balance | string | null | balanceRaw divided by 10^decimals, computed exactly in arbitrary precision and published as a string (never a floating-point number, to avoid losing digits on a large, high-precision balance). null only when decimals is null. |
Start building with DexData today
Sign in, create a key and make your first call in a minute. Free credits every month, and you only pay for calls that succeed.
Get a free API key