Ethereum
trace_filter
trace_filter is the search method of Ethereum's trace namespace. Instead of fetching the traces for one transaction or one block, you hand it a filter and it sweeps a range of blocks for every trace that matches. You can narrow by sender (fromAddress), recipient (toAddress), and a fromBlock/toBlock window, then page through the results with after and count. It's how you find, say, every internal ETH transfer that ever hit a particular contract on Ethereum mainnet (chain ID 1) without replaying each block yourself. Queries go to https://ethereum.therpc.io/YOUR_API_KEY, and each match comes back in the same flat shape as trace_transaction, carrying its own transactionHash and blockNumber.
Use cases
- Set
toAddressto a contract and collect every internal ETH transfer it received across a block range, including value moves that left no log behind. - Watch known MEV bots by listing their addresses in
fromAddress, then study the calls they fired to map out arbitrage and liquidation strategies. - Index a DeFi protocol end to end. Filter on a MakerDAO or Aave contract address and stream all calls into your own database for analytics.
- Run forensics around an exploit by pulling every interaction with the victim contract in the blocks before and after the incident, reconstructing how funds drained.
Parameters
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | filter | object | Yes | Filter object with the following optional fields. |
Response
| Type | Description |
|---|---|
| array | Flat array of matching trace objects, each with the same shape as trace_transaction results: `{action, result, subtraces, traceAddress, transactionHash, transactionPosition, blockHash, blockNumber, type}`. |
Example request
Try it live in the Ethereum playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32601 | Method not found | trace namespace not enabled or client does not support trace_filter. |
-32602 | Invalid params | Filter object contains invalid fields, or block range is too wide for the node's configured limit. |
-32000 | query returned more than X results | Result set exceeded the node's per-request limit; narrow the block range or use pagination. |
Common pitfalls
- A wide
fromBlock/toBlockwindow is brutally slow and will often be rejected outright. Keep the range tight and walk it withafter/countpagination rather than asking for a million blocks in one shot. - The method only exists on a trace-enabled archive node. Most public Ethereum endpoints never expose the trace namespace at all.
- Traces aren't indexed the way logs are.
eth_getLogslets you filter by event topic;trace_filteronly filters by address and block number, so you cannot query by event signature here.
Supported networks
- Mainnet — Chain ID: 1
- Sepolia — Chain ID: 11155111
See also
Parameters
Filter object with the following optional fields.