For the complete documentation index, see llms.txt. This page is also available as Markdown.

eth_getLogs - Ethereum

eth_getLogs on Ethereum: returns the event logs that match a filter. Parameters, response and request example for the RPC Fast endpoint.

Returns the event logs that match a filter.

Keep block ranges small and filter by address or topics: a wide range over a busy chain takes long and costs the same per call.

Parameters

  1. filter (object) — Log filter

    • fromBlock (string) — Optional. First block, block number as hex, or a tag: latest, earliest, pending, safe, finalized

    • toBlock (string) — Optional. Last block, same format as fromBlock

    • address (address | array) — Optional. Contract address or list of addresses

    • topics (array) — Optional. Topic filters by position; null matches anything, a nested array matches any of its values

    • blockHash (hash) — Optional. Restricts the result to one block; cannot be combined with fromBlock/toBlock

Returns

Array of logs: address, topics, data, blockNumber, blockHash, transactionHash, transactionIndex, logIndex and removed.

Example

Request

curl https://eth-mainnet.rpcfast.com/?api_key=<API_KEY> \
  -X POST -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getLogs","params":[{"fromBlock":"0x192a337","toBlock":"0x192a337","address":"0xdac17f238db9863dae526eb0dc935e7cf9fcec54"}]}'

Response

See Compute Units for the price of this method on Ethereum.

Last updated