BNB Smart Chain
trace_filter
The other trace methods start from a single transaction or block. trace_filter works the other way around: you hand it search criteria, and it sweeps a range of BSC blocks for every trace that matches. Filter by sender or recipient address, set a from/to block window, and page through results with after and count. Query it on chain ID 56 at https://bsc.therpc.io/YOUR_API_KEY. The result is a flat array of every matching call, create, or self-destruct across all the blocks in range. BSC's ~3s blocks carry heavy BEP-20 and DeFi traffic, so that range can be enormous, which is why the call is heavy and depends on a trace-enabled archive node holding the full historical index.
Use cases
- Find every internal BNB transfer sent to a contract across a block range, without scanning each transaction by hand.
- Detect MEV bot activity by filtering for traces that originate from known bot addresses over a window of blocks.
- Build an indexer that captures all calls into a specific DeFi protocol such as Venus or PancakeSwap.
- Audit every interaction with a contract in the blocks before and after an exploit.
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 BNB Smart Chain 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
- Wide block ranges run slowly and providers may reject them outright, so keep the window tight and page through results.
- A trace-enabled archive node is required, and most public endpoints either hide this method or gate it behind higher tiers.
- Unlike
eth_getLogs, traces are indexed only by address and block number, never by event topic, so you cannot filter on a log signature.
Supported networks
- Mainnet — Chain ID: 56
- Testnet — Chain ID: 97
See also
Parameters
Filter object with the following optional fields.