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
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | filterId | string | Yes | The hex filter ID to remove. |
Response
| Type | Description |
|---|---|
| boolean | `true` if the filter was found and removed. `false` if it did not exist (already expired or never created). |
Example request
Try it live in the Ethereum playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32602 | invalid argument | The filter ID is not a valid hex string. |
Common pitfalls
- Getting
falseback 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.