BNB Smart Chain

BNB Smart Chain

eth_getFilterLogs

On BNB Smart Chain, the BNB-gas EVM network whose validators seal blocks under Proof-of-Staked-Authority, you can register a reusable log filter and then snapshot it. eth_getFilterLogs takes an existing log-filter ID and returns the complete set of logs matching its address and topic criteria, ignoring whatever cursor eth_getFilterChanges may have advanced. In other words it gives you the whole history the filter would have matched, not just the delta. Call it through https://bsc.therpc.io/YOUR_API_KEY on chain ID 56 to seed an index with the full match set before switching to incremental polling.

Use cases

  • At application start-up, grab the entire historical match set for your BSC filter in one shot, then hand off to eth_getFilterChanges for live deltas.
  • After a crash or redeploy, replay every event the service may have missed by snapshotting the filter here before the next incremental poll runs.

Parameters

#NameTypeRequiredDescription
1filterIdstringYesThe log filter ID. Only log filters (eth_newFilter) are valid — block and pending-tx filters are not supported.

Response

TypeDescription
arrayArray of all log objects matching the filter's criteria.

Example request

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

Try it live in the BNB Smart Chain playground.

Errors & troubleshooting

CodeMessageCause
-32000filter not foundFilter ID is invalid, expired, or the filter was already uninstalled.
-32005query returned more than 10000 resultsThe filter matches too many logs; narrow the block range or add topic filters.

Common pitfalls

  • Where the incremental sibling returns only fresh entries, this method re-emits the entire match set every time. That gets costly when the filter spans a broad block range on busy chain-56 contracts.
  • It accepts log-filter IDs from eth_newFilter exclusively; feed it a block or pending-transaction filter ID and the node rejects the request.
  • Since the node drops the filter after roughly five minutes idle, snapshot it soon after creation rather than letting the handle go stale.

Supported networks

  • Mainnet — Chain ID: 56
  • Testnet — Chain ID: 97

See also

Parameters

Hex filter ID from eth_newFilter

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

Ready to call this in production?

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