Chains API
The blocks in a rollup settlement batch
Every rollup block one settlement batch carries, newest first, 50 per page: number, hash, timestamp, transaction count, gas and base fee.
/api/external/chain-analysis/rollup-batch-blocks/{chain}What it returns
Every rollup block in one settlement batch, newest first, 50 per page. A batch is one contiguous block range, so the walk ends at the batch's first block; keep passing nextCursor back as cursor until it is null. Where the batch stands on the parent chain, and its block range and transaction count, are in rollup-settlement. A batch that does not exist or is not indexed yet is a 404 (OP batch numbers skip values, so some OP numbers never exist).
Chains
- Robinhood Chain RHC
- Optimism OP
- Scroll SCROLL
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/rollup-batch-blocks/RHC"
| Parameter | Description |
|---|---|
batchquery · integer · optional | The settlement batch number. Required. |
cursorquery · string · optional | An opaque cursor from a previous response's nextCursor, for the next page. It only pages the chain and batch it was issued for; an empty one, or one over 256 characters, is a 400 (enforced after the API-key gate). |
chainpath · string · required | RHC, OP or SCROLL; 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 |
|---|---|---|
batch | integer | The batch asked about. |
blocks | object[] | Newest first, one contiguous run of block numbers. Never empty. |
blocks[].number | integer | The block number. |
blocks[].hash | string | The block hash. |
blocks[].parentHash | string | null | The previous block's hash; null when not known. |
blocks[].timestamp | integer | null | Unix seconds the block was produced at; null when not known. |
blocks[].transactionCount | integer | null | Transactions in the block, system transactions included; null when not known. |
blocks[].gasUsed | string | null | Gas used, as a decimal string; null when not known. |
blocks[].gasLimit | string | null | The block gas limit, as a decimal string; null when not known. |
blocks[].baseFeePerGasWei | string | null | The base fee per gas in wei, as a decimal string; null when not known. |
blocks[].miner | string | null | The address the block names as its producer, lowercase; null when not known. |
nextCursor | string | null | Pass back as cursor for the next page. null on the last page. |
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