Skip to main content
Returns an array of all logs matching a given filter object. Particularly useful for indexing on-chain events.
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" on a https://mainnet-preconf.base.org endpoint to query logs from pre-confirmed transactions, updated every ~200ms. For a real-time stream, consider the pendingLogs WebSocket subscription instead.

Parameters

filter
object
required
The filter options. At least one criterion should be provided.

Returns

result
array
Array of log objects matching the filter.

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
  }'