eth_getFilterChanges
The eth_getFilterChanges method is a polling method for filters which returns an array of logs, block hashes, or transaction hashes that occurred since the last poll. This method is the primary way to retrieve incremental updates from filters created with eth_newFilter, eth_newBlockFilter, or eth_newPendingTransactionFilter.
The method is essential for building event-driven applications that need to react to blockchain changes efficiently. Unlike eth_getLogs which queries historical data, eth_getFilterChanges provides only new data since the last poll, making it ideal for real-time monitoring. Applications use this extensively for tracking contract events, monitoring new blocks, watching pending transactions, and building notification systems. The filter automatically tracks what data has been returned, ensuring you never receive duplicate results.
Filters timeout after 5 minutes of inactivity. Regular polling with eth_getFilterChanges keeps the filter active.
Parameters
parameter | type | description |
|---|---|---|
filterId | string (required) | The filter ID returned from eth_newFilter, eth_newBlockFilter, or eth_newPendingTransactionFilter |
Return Object
field | type | description |
|---|---|---|
result | string | An array of log objects for event logs, an array of block hashes for block filters, or an array of transaction hashes for pending transaction filters. Returns an empty array if nothing has changed since last poll |
Request Example
Response Example