Skip to main content

eth_subscribe RPC Method

Subscribes to new block headers over a WebSocket connection.

Updated on
Dec 02, 2026

Parameters

subscription type
string
REQUIRED

The event stream to subscribe to. The newHeads type sends a notification when a new block header is added.

newHeads

New block headers

Returns

result
string

A hexadecimal subscription ID. Use it to cancel the subscription with eth_unsubscribe on the same WebSocket connection.

Request
Response
1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"result": "0x9cef478923ff08bf67fde6c64013158d"
5
}
1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"result": "0x9cef478923ff08bf67fde6c64013158d"
5
}
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free