Queries spanning large block ranges or high-activity contracts can time out or be rejected. Keep
fromBlock-to-toBlock ranges under 2,000 blocks for reliable results. Node providers may enforce their own limits.Flashblocks: Set
"fromBlock": "pending" and "toBlock": "pending" to query logs from pre-confirmed transactions, updated every ~200ms. For a real-time stream, consider the pendingLogs WebSocket subscription instead.Parameters
object
required
The filter options. At least one criterion should be provided.
Show Filter fields
Show Filter fields
string
Start of the block range. Block number in hex or a block tag. Use
"pending" to include pre-confirmed logs. Defaults to "latest".string
End of the block range. Block number in hex or a block tag. Defaults to
"latest".string | array
A contract address or array of addresses to filter by. Optional.
array
Array of 32-byte topic filters. Each position can be
null (match any), a single topic hex string, or an array of hex strings (match any in the array). Position 0 is typically the keccak256 hash of the event signature. Optional.string
Restricts logs to the block with this hash. If provided,
fromBlock and toBlock are ignored. Optional.Returns
array
Array of log objects matching the filter.
Show Log object fields
Show Log object fields
string
20-byte address of the contract that emitted the log.
array
Array of 0–4 indexed 32-byte topics. Topic 0 is typically the event signature hash.
string
ABI-encoded non-indexed event parameters.
string
Block number in which this log was emitted (hex).
string
Unix timestamp of the block containing this log as a hex string. Base L2 extension to the standard Ethereum log schema.
string
32-byte hash of the transaction that emitted this log.
string
Index of the transaction in the block (hex).
string
32-byte hash of the block.
string
Log’s index position within the block (hex).
boolean
true if the log was removed due to a chain reorganization.Example
curl https://mainnet.base.org \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getLogs",
"params": [{
"fromBlock": "0x12ced00",
"toBlock": "0x12ced28",
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
}],
"id": 1
}'
curl https://mainnet.base.org \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getLogs",
"params": [{
"fromBlock": "pending",
"toBlock": "pending",
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
}],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"address": "0x4200000000000000000000000000000000000006",
"blockHash": "0x89f4c9e23a2f706f0afa9ca8f770c4b7dcbcb73ba7e9b1c29c4a8c1b90c31d24",
"blockNumber": "0x2c31b0a",
"blockTimestamp": "0x6a1092f7",
"data": "0x00000000000000000000000000000000000000000000000080134424aad49d08",
"logIndex": "0x0",
"removed": false,
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000b2cc224c1c9fee385f8ad6a55b4d94e92359dc59",
"0x00000000000000000000000051c72848c68a965f66fa7a88855f9f7784502a7f"
],
"transactionHash": "0x2ca798df9d399b886fb3735414e8d35a20fec080e48eb5e2e75c0f6ec349a725",
"transactionIndex": "0x1"
}
]
}