Get a range of blocks with optional decoded transactions and logs
Returns details for the requested range of blocks on a single chain: header fields, the full transaction list (optional), and per-transaction logs (optional). Use the decodeTxData and decodeLogs flags to receive resolved method/event signatures and decoded inputs.
Pass blockchain, then fromBlock and toBlock as either integers, hex strings, or the keywords earliest / latest. Maximum range is 30 blocks per call. includeLogs requires includeTxs to also be true.
Part of the Query API product (700 compute units per call, $0.00007 at base rate).
Request
- Base URLhttps://rpc.ankr.com/multichain/569ca1f392f7d3d0bb1073a1173ecb649af1d9249231fe59fa95db19d5ae41fe
- Authnone declared
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"id": 1,
"jsonrpc": "2.0",
"method": "ankr_getBlocks",
"params": {
"blockchain": "eth",
"fromBlock": "latest",
"toBlock": "latest",
"decodeLogs": true,
"decodeTxData": true,
"includeLogs": true,
"includeTxs": true
}
}Response
Success. JSON-RPC result contains the blocks array. JSON-RPC errors are returned with HTTP 200; check the response body for an error key.
Changes
No recorded changes to this operation across all 1 revision of this API.