Skip to main content

eth_newBlockFilter

Overview

The 'eth_newBlockFilter' method creates a filter in the node to notify when a new block arrives. To check if the state has changed, call 'eth_getFilterChanges'.

'Duration':

Filter IDs will be valid for up to fifteen minutes.

*'Usage'**:

Filter IDs can be polled by any connection using the same YOUR-COINAPI-KEY.

Request

curl --request POST \
--url https://eth-mainnet.g.alchemy.com/v2/docs-demo \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'X-CoinAPI-Key: 73034021-THIS-IS-SAMPLE-KEY' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_newBlockFilter"
}'

Request Parameters

  • None.

Response

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x44d29f10bae3cb79e4b5503ad282991f"
}
  • filter ID: A hexadecimal denoting the newly created filter ID.