Query historical contract logs filtered by address, topic, and block range
Returns indexed contract logs (events) for the requested chain and block range. Standard eth_getLogs semantics, plus multi-chain dispatch, pagination, and optional event-signature decoding via decodeLogs: true.
Pass blockchain and either a block range (fromBlock / toBlock) or a time range (fromTimestamp / toTimestamp). Scope by address (single or array of contracts) and / or topics (nested arrays matching eth_getLogs topic filter semantics). Paginate with pageSize (default 1000, max 10000) and pageToken.
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_getLogs",
"params": {
"blockchain": [
"eth"
],
"address": [
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
],
"fromBlock": "earliest",
"toBlock": "latest",
"topics": [
[
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
]
],
"pageSize": 1
}
}Response
Success. JSON-RPC result envelope contains the logs array and pagination cursor. 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.