Ethereum

Ethereum

eth_getFilterLogs

eth_getFilterLogs returns the full set of logs that match a log filter you previously registered with eth_newFilter, ignoring any polling you've already done against it. Where eth_getFilterChanges hands you only the delta since the last call, this method gives you the whole matching set every time — a snapshot, not a stream. It works only on log filters; block and pending-tx filter IDs are rejected. Run it against Ethereum mainnet (chain ID 1, the EVM chain settled in ETH) through https://ethereum.therpc.io/YOUR_API_KEY, and you get back every log across the filter's block range that matches its address and topic criteria, regardless of where your poll cursor sat.

Use cases

  • On startup, pull the complete matching log set once — say every Transfer for a USDC or Lido token contract over the filter's range — then switch to eth_getFilterChanges for incremental updates.
  • After a service restart, replay everything the filter covers by calling this before the next eth_getFilterChanges, so you recover events that fired while your indexer was down rather than resuming mid-stream and missing them.

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://ethereum.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 Ethereum 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

  • This returns every matching log, not just the new ones, so a filter spanning a wide range over a busy contract can blow past the 10,000-result cap and trip a -32005 error. Keep the filter's block window tight or lean on topic filters.
  • Only log filters work here. Hand it a block-filter or pending-tx-filter ID from eth_newBlockFilter / eth_newPendingTransactionFilter and you get filter not found — those have no concept of a log set.
  • Filters lapse after roughly five minutes of inactivity, so call this soon after eth_newFilter. If the filter expired, recreate it; for one-off historical pulls eth_getLogs skips the filter lifecycle entirely.

Supported networks

  • Mainnet — Chain ID: 1
  • Sepolia — Chain ID: 11155111

See also

Parameters

Hex filter ID from eth_newFilter

curl https://ethereum.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.