Ethereum
eth_newBlockFilter
eth_newBlockFilter registers a server-side filter that watches for new blocks on Ethereum and hands you back a hex filter ID. There are no parameters: the filter simply accumulates the hash of every block the node sees, and you drain that buffer by polling eth_getFilterChanges with the ID. Each poll returns the block hashes that arrived since your last call, so on mainnet you can expect roughly one new hash per 12-second slot under PoS. Create the filter against https://ethereum.therpc.io/YOUR_API_KEY on chain ID 1. This is the lightest of the filter family, since it tracks block arrivals rather than logs or mempool entries, and it pairs with eth_uninstallFilter for cleanup.
Use cases
- Drive a per-block work loop: on each new hash, re-check the status of transactions you broadcast, since a fresh Ethereum block is the only moment new inclusions can happen.
- Bust caches on every new block hash, so price reads, balances, and contract state you memoized never lag more than one 12-second slot behind the chain head.
Parameters
This method takes no parameters. Pass an empty array [].
Response
| Type | Description |
|---|---|
| string | Hex filter ID. When polled with eth_getFilterChanges, yields an array of new block hashes since the last poll. |
Example request
Try it live in the Ethereum playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32000 | filter not found | Provider rejected filter creation or the filter limit was reached. |
Common pitfalls
- The filter yields bare block hashes, nothing more. To get a block's transactions or header you still call
eth_getBlockByHashwith each hash. - Nodes time out idle filters after a few minutes. If
eth_getFilterChangescomes back with a filter-not-found error, recreate the filter and resume. - A hash at the chain head can still be reorged before justification. For anything that moves ETH, wait for the
safeorfinalizedtag (about 12.8 minutes for full finality) before treating a block as settled.
Supported networks
- Mainnet — Chain ID: 1
- Sepolia — Chain ID: 11155111