Ethereum
eth_getFilterChanges
eth_getFilterChanges is the polling half of Ethereum's filter API. You create a filter once — with eth_newFilter, eth_newBlockFilter, or eth_newPendingTransactionFilter — and then call this method repeatedly to drain only what's new since your last poll. The node remembers a cursor per filter, so each call hands back the delta and advances it. What comes back depends on the filter: a log filter yields log objects, a block filter yields fresh block hashes, a pending-tx filter yields transaction hashes from the mempool. On mainnet (chain ID 1, fees paid in ETH) a sensible poll cadence tracks the 12-second slot. The endpoint is https://ethereum.therpc.io/YOUR_API_KEY; for a true push stream over WebSocket, eth_subscribe is the alternative.
Use cases
- Watch a contract's events by registering the address and topics once, then polling roughly every 12 seconds — about one Ethereum slot — without resending the filter criteria each time.
- Drive a block-tick loop: call
eth_newBlockFilteronce, then poll here to collect each new head hash as validators seal slots, useful for cron-style work that should fire once per block.
Parameters
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | filterId | string | Yes | The filter ID to poll. |
Response
| Type | Description |
|---|---|
| array | For log filters: array of log objects. For block filters: array of block hash strings. For pending-tx filters: array of transaction hash strings. Empty array if no new events. |
Example request
Try it live in the Ethereum playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32000 | filter not found | Filter ID is invalid, expired (>5 min inactivity), or was already uninstalled. |
Common pitfalls
- Filters are ephemeral and get dropped after about five minutes of no polling. When that happens you'll see a
filter not founderror (-32000); catch it, recreate the filter, and replay from your last known block. - For log filters, read the
removedflag on each entry. A short single-block reorg at the chain head can re-deliver a log withremoved: true, and money-handling code must undo whatever it did for the original. - There's a cost balance: poll too hard and you burn Compute Units on empty deltas; poll slower than the ~5-minute expiry window and your filter quietly dies between calls.
Supported networks
- Mainnet — Chain ID: 1
- Sepolia — Chain ID: 11155111
See also
Parameters
Hex filter ID from eth_newFilter, eth_newBlockFilter, or eth_newPendingTransactionFilter