Ethereum

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 toAddress to 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

#NameTypeRequiredDescription
1filterobjectYesFilter object with the following optional fields.

Response

TypeDescription
arrayFlat 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

curl https://ethereum.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "trace_filter",
"params": [{}],
"id": 1
}'

Try it live in the Ethereum playground.

Errors & troubleshooting

CodeMessageCause
-32601Method not foundtrace namespace not enabled or client does not support trace_filter.
-32602Invalid paramsFilter object contains invalid fields, or block range is too wide for the node's configured limit.
-32000query returned more than X resultsResult set exceeded the node's per-request limit; narrow the block range or use pagination.

Common pitfalls

  • A wide fromBlock/toBlock window is brutally slow and will often be rejected outright. Keep the range tight and walk it with after/count pagination 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_getLogs lets you filter by event topic; trace_filter only 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.

curl https://ethereum.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"trace_filter","params":[null]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.