Ethereum

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_newBlockFilter once, 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

#NameTypeRequiredDescription
1filterIdstringYesThe filter ID to poll.

Response

TypeDescription
arrayFor 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

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

Try it live in the Ethereum playground.

Errors & troubleshooting

CodeMessageCause
-32000filter not foundFilter 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 found error (-32000); catch it, recreate the filter, and replay from your last known block.
  • For log filters, read the removed flag on each entry. A short single-block reorg at the chain head can re-deliver a log with removed: 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

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

Ready to call this in production?

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