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.
/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>"
| Parameter | Description |
|---|---|
blockNumberquery · integer · optional | The block height. Give this or blockHash, not both. |
blockHashquery · string · optional | The block hash, 0x followed by 64 hexadecimal characters. Give this or blockNumber, not both. |
indexquery · integer · required | The position in the block, from 0: 0 to 99999. |
chainpath · 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.
| Field | Type | Description |
|---|---|---|
transactionCount | integer | null | How many transactions the block holds; 0 is a real empty block. null when the chain has no such block. |
transaction | object | null | The transaction at index, or null when the block does not exist or holds fewer. |
transaction.hash | string | The transaction hash, lowercase. |
transaction.index | integer | Its position in the block, the index asked for. |
transaction.blockNumber | integer | The block height. |
transaction.blockHash | string | The block hash, lowercase. |
transaction.blockTimestamp | integer | null | Unix seconds the block was produced at; null when the chain does not attach it to the transaction. |
transaction.from | string | The sender, lowercase. |
transaction.to | string | null | The recipient or contract called, lowercase; null when the transaction creates a contract. |
transaction.valueWei | string | Native coin sent, in wei, as a decimal string. "0" is a real value. |
transaction.nonce | integer | The sender's nonce. |
transaction.type | integer | null | The 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.gasLimit | string | The gas limit the sender set, as a decimal string. |
transaction.gasPriceWei | string | null | The gas price the chain reports for it, in wei, as a decimal string; null when none is reported. |
transaction.maxFeePerGasWei | string | null | The fee cap of a fee-market transaction, in wei; null for other types. |
transaction.maxPriorityFeePerGasWei | string | null | The priority fee cap of a fee-market transaction, in wei; null for other types. |
transaction.methodId | string | null | The first four bytes of the call data, the method selector; null when the call data is shorter. |
transaction.inputBytes | integer | Length 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