Contracts API
Read a contract's storage slots
Returns the raw 32-byte words in an EVM contract's storage slots, at the latest block or a past one, optionally with a Merkle proof.
/api/external/contract-analysis/contract-storage/{chain}/{address}What it returns
Returns the 32-byte words stored in one or more storage slots of a contract, at the latest block or, on Base, Stable, Arc and RHC, at a past block. An unused slot is a real zero word. On Ethereum and BNB, proof=true adds the Merkle proof of the account and of each slot at the latest block; each storage proof is checked to start at the account's storageHash. Past blocks elsewhere, and proofs elsewhere or at a past block, return 400.
Chains
- BNB Chain BNB
- Ethereum ETH
- Stable STABLE
- Base BASE
- Robinhood Chain RHC
- Arc ARC
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/contract-analysis/contract-storage/BNB/<address>?slots=<slots>"
| Parameter | Description |
|---|---|
slotsquery · string · required | Up to 16 slot keys, comma-separated, each a decimal number or 0x hex of at most 32 bytes, e.g. 0 or 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc (the EIP-1967 implementation slot). |
blockquery · integer · optional | The block to read at. Omit for the latest block. Base, Stable, Arc and RHC only. |
proofquery · boolean · optional | Add the Merkle proof of the account and each slot. Ethereum and BNB, at the latest block only. |
chainpath · string · required | Ethereum, BNB, Base, Stable, Arc or RHC. SOL returns 400: Solana accounts have no storage slots. CELO, ARB, OP and SCROLL return 400 here. |
addresspath · string · required | The contract whose storage is read, 0x followed by 40 hexadecimal characters. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
address | string | The contract, lowercase. |
block | object | null | The past block read at; null for the latest block. |
block.number | integer | The block read at. |
block.hash | string | Its hash. |
slots | object[] | One per slot asked for, in the same order. |
slots[].slot | string | The slot key, as a 32-byte word. |
slots[].value | string | The word stored there, lowercase hex. |
proof | object | null | The Merkle proof, when proof=true; else null. |
proof.balance | string | The account's balance in wei, a decimal string. |
proof.nonce | string | The account's nonce, a decimal string. |
proof.codeHash | string | The hash of the contract's code. |
proof.storageHash | string | The root of the account's storage trie. |
proof.accountProof | string[] | RLP-encoded trie nodes from the state root down to the account. |
proof.storageProof | object[] | One per slot, in the same order as slots. |
proof.storageProof[].slot | string | |
proof.storageProof[].proof | string[] | RLP-encoded trie nodes from storageHash down to the slot. |
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