Ethereum

Ethereum

eth_uninstallFilter

When you create a polling filter on Ethereum, the node holds state for it on your behalf. eth_uninstallFilter tears that state down. Pass the hex filter ID you got from eth_newFilter, eth_newBlockFilter, or eth_newPendingTransactionFilter, send it to https://ethereum.therpc.io/YOUR_API_KEY on mainnet (chain ID 1), and the node drops the filter and stops buffering matches for it. It works for every filter type, since they all share the same ID space. The return is a simple boolean: true when the filter existed and was removed, false when there was nothing there to remove. Cleaning up promptly matters because each open filter consumes memory on the node serving your ETH workload.

Use cases

  • Release a log filter once a monitoring session ends, for example after you stop watching Transfer events on a specific ERC-20 contract.
  • Tear down every active filter your indexer or bot created during a clean shutdown so the Ethereum node reclaims the memory immediately.

Parameters

#NameTypeRequiredDescription
1filterIdstringYesThe hex filter ID to remove.

Response

TypeDescription
boolean`true` if the filter was found and removed. `false` if it did not exist (already expired or never created).

Example request

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

Try it live in the Ethereum playground.

Errors & troubleshooting

CodeMessageCause
-32602invalid argumentThe filter ID is not a valid hex string.

Common pitfalls

  • Getting false back is not a failure. It usually just means the filter already expired before you reached it, so treat it as "nothing to do" rather than an error to retry.
  • Ethereum nodes drop idle filters automatically after roughly five minutes without a poll, but leaning on that timeout is sloppy. Calling this method when you are done frees the resource the moment you stop needing it instead of leaving it to age out.

Supported networks

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

See also

Parameters

The hex filter ID to remove.

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

Ready to call this in production?

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