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.

GET/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>"
Parameters
ParameterDescription
slots

query · 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).
block

query · integer · optional

The block to read at. Omit for the latest block. Base, Stable, Arc and RHC only.
proof

query · boolean · optional

Add the Merkle proof of the account and each slot. Ethereum and BNB, at the latest block only.
chain

path · 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.
address

path · 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.

Response fields of Read a contract's storage slots
FieldTypeDescription
addressstringThe contract, lowercase.
blockobject | nullThe past block read at; null for the latest block.
block.numberintegerThe block read at.
block.hashstringIts hash.
slotsobject[]One per slot asked for, in the same order.
slots[].slotstringThe slot key, as a 32-byte word.
slots[].valuestringThe word stored there, lowercase hex.
proofobject | nullThe Merkle proof, when proof=true; else null.
proof.balancestringThe account's balance in wei, a decimal string.
proof.noncestringThe account's nonce, a decimal string.
proof.codeHashstringThe hash of the contract's code.
proof.storageHashstringThe root of the account's storage trie.
proof.accountProofstring[]RLP-encoded trie nodes from the state root down to the account.
proof.storageProofobject[]One per slot, in the same order as slots.
proof.storageProof[].slotstring
proof.storageProof[].proofstring[]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