Chains API
The newest blocks on a chain
The newest blocks one EVM chain has produced, head first, with hash, time, transaction count, gas, base fee and miner.
/api/external/chain-analysis/latest-blocks/{chain}What it returns
The newest limit blocks one chain has produced, head first and one per height: number, hash, parent hash, time, transaction count, gas used and limit, base fee and the miner address. Gas figures and the base fee are decimal strings (the base fee in wei); "0" is a real value, as on BNB, and null means it was not published. What miner names differs by chain: the validator on BNB, the fee recipient on Ethereum (usually a block builder), a sequencer fee vault on Base, the fixed sequencer address on RHC. On the fastest chains the head moves several times a second, so two calls a second apart rarely agree on it.
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/latest-blocks/BNB"
| Parameter | Description |
|---|---|
limitquery · integer · optional | How many blocks to return, head included: 1 to 20. Defaults to 10. |
chainpath · string · required | Ethereum, BNB, Base, Stable, Arc or RHC. SOL returns 400: no wired source publishes its newest slots with hashes and times, only a bare slot number. CELO, ARB, OP and SCROLL return 400 here. |
Response fields
A JSON response. Every field is always present; null means the value could not be established, never zero.
| Field | Type | Description |
|---|---|---|
blocks | object[] | Head first, one block per height. |
blocks[].number | integer | The block height. |
blocks[].hash | string | The block hash. |
blocks[].parentHash | string | null | The hash of the block before this one, or null when not published. |
blocks[].timestamp | integer | null | Unix seconds the block was produced at. |
blocks[].transactionCount | integer | null | Transactions in the block. 0 is a real empty block, different from null. |
blocks[].gasUsed | string | null | Gas used by the block, as a decimal string. |
blocks[].gasLimit | string | null | The block gas limit, as a decimal string. RHC reports a fixed 1125899906842624 (2^50) on every block — a real value, not a limit blocks approach. |
blocks[].baseFeePerGasWei | string | null | Base fee per gas in wei, as a decimal string. "0" is real (BNB); null means not published. |
blocks[].miner | string | null | The address the block names as its miner — see the endpoint description for what it is per chain. |
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