Chains API

The transaction at a given position in a block

The transaction at one index of an EVM block named by number or hash: sender, recipient, value, nonce, type, gas limit, fee caps and method, plus the block's transaction count.

GET/api/external/chain-analysis/block-transaction/{chain}

What it returns

The transaction at position index (from 0) of one block named by height or hash, as the block records it: hash, sender, recipient, value, nonce, type, gas limit and fee caps, and the method called. It is the signed transaction, not its outcome: no status, gas used or events. The answer also gives how many transactions the block holds, so a caller can walk the block. transaction is null when the block holds fewer, and both fields are null when the chain has no such block. Ethereum keeps blocks from 15,500,000, Base keeps transactions from 50,000,000 and Stable about the last two million blocks (some two weeks); an older block is a 400, naming the oldest one kept when the chain says. On Stable an older hash reads as unknown: both null.

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/chain-analysis/block-transaction/BNB?index=<index>"
Parameters
ParameterDescription
blockNumber

query · integer · optional

The block height. Give this or blockHash, not both.
blockHash

query · string · optional

The block hash, 0x followed by 64 hexadecimal characters. Give this or blockNumber, not both.
index

query · integer · required

The position in the block, from 0: 0 to 99999.
chain

path · string · required

ETH, BNB, BASE, STABLE, ARC or RHC; every other chain returns 400.

Response fields

A JSON response. Every field is always present; null means the value could not be established, never zero.

Response fields of The transaction at a given position in a block
FieldTypeDescription
transactionCountinteger | nullHow many transactions the block holds; 0 is a real empty block. null when the chain has no such block.
transactionobject | nullThe transaction at index, or null when the block does not exist or holds fewer.
transaction.hashstringThe transaction hash, lowercase.
transaction.indexintegerIts position in the block, the index asked for.
transaction.blockNumberintegerThe block height.
transaction.blockHashstringThe block hash, lowercase.
transaction.blockTimestampinteger | nullUnix seconds the block was produced at; null when the chain does not attach it to the transaction.
transaction.fromstringThe sender, lowercase.
transaction.tostring | nullThe recipient or contract called, lowercase; null when the transaction creates a contract.
transaction.valueWeistringNative coin sent, in wei, as a decimal string. "0" is a real value.
transaction.nonceintegerThe sender's nonce.
transaction.typeinteger | nullThe transaction type: 0 legacy, 1 access list, 2 fee market, 3 blob, 4 set code; other numbers are chain-specific, such as Base's 126 for a deposit.
transaction.gasLimitstringThe gas limit the sender set, as a decimal string.
transaction.gasPriceWeistring | nullThe gas price the chain reports for it, in wei, as a decimal string; null when none is reported.
transaction.maxFeePerGasWeistring | nullThe fee cap of a fee-market transaction, in wei; null for other types.
transaction.maxPriorityFeePerGasWeistring | nullThe priority fee cap of a fee-market transaction, in wei; null for other types.
transaction.methodIdstring | nullThe first four bytes of the call data, the method selector; null when the call data is shorter.
transaction.inputBytesintegerLength of the call data in bytes; 0 for a plain transfer.

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