Transactions API
Every balance one transaction changed
Per address and asset, the balance before and after one transaction and the signed difference — native coin and fee, fungible tokens and NFTs. RHC, ETH, OP and SCROLL.
/api/external/transaction-analysis/transaction-state-changes/{chain}/{hash}What it returns
Per address and asset, the balance before and after one transaction — the native coin (the fee paid included, and the block producer's share of it), every fungible token and every NFT. Amounts are raw base units as decimal strings, paired with the token decimals; change is signed (negative when the balance fell). An ERC-721 row lists the token ids that moved in nftMovements instead of a change, and its balances are counts of tokens held; an ERC-1155 row names the tokenId its balances are of. balanceBefore and balanceAfter are null when no balance is held for that address (the zero address of a mint). An unknown transaction hash returns 404, never an empty list. Up to about 8 seconds on ETH, under 2 on the other chains. RHC, ETH, OP and SCROLL.
Chains
- Ethereum ETH
- Robinhood Chain RHC
- Optimism OP
- Scroll SCROLL
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/transaction-analysis/transaction-state-changes/ETH/<hash>"
| Parameter | Description |
|---|---|
chainpath · string · required | RHC, ETH, OP or SCROLL; every other chain returns 400, because no wired source answers balances before and after a transaction for it. |
hashpath · string · required | The transaction hash: 0x followed by 64 hexadecimal characters. Not a Solana signature (base58) — Solana is not served by this resource. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
hash | string | The transaction asked about, lowercase. |
stateChanges | object[] | One row per address and asset whose balance the transaction changed. |
stateChanges[].address | string | The address whose balance changed, lowercase. |
stateChanges[].asset | string | native for the chain's own coin, token for everything else. |
stateChanges[].token | object | null | The token; null on a native row. |
stateChanges[].token.address | string | The token contract, lowercase. |
stateChanges[].token.standard | string | The token standard: "ERC-20", "ERC-721", "ERC-1155", … |
stateChanges[].token.symbol | string | null | |
stateChanges[].token.decimals | integer | null | Divide the raw amounts by 10^decimals. null on an NFT, or when unknown. |
stateChanges[].tokenId | string | null | The ERC-1155 token id the balances are of; null on every other row. |
stateChanges[].balanceBefore | string | null | Raw base units (an NFT: tokens held) before the transaction. |
stateChanges[].balanceAfter | string | null | Raw base units (an NFT: tokens held) after the transaction. |
stateChanges[].change | string | null | balanceAfter minus balanceBefore, signed raw base units. null on an ERC-721 row. |
stateChanges[].nftMovements | object[] | null | The ERC-721 token ids that moved for this address; null on every other row. |
stateChanges[].nftMovements[].tokenId | string | |
stateChanges[].nftMovements[].direction | string | in when the address received the token, out when it gave it up. |
stateChanges[].isBlockProducer | boolean | true on the fee recipient of the block, whose native balance rose by its share of the fee (on a rollup, part of the fee goes elsewhere). |
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