⚡ Test Our Private Nodes of 40+ Blockchains just for $50!

coins coins coins coins

Method: POST eth_subscribe

dropdown

# eth_subscribe example for Ethereum (ETH)

POST eth_subscribe

Subscriptions are created with a regular RPC call with eth_subscribe as method and the subscription name as first parameter. If successful it returns the subscription id.

Parameters

name - string

subscription name

arguments - array of string

optional arguments

Request

curl --location --request POST 'https://geth.getblock.io/mainnet/' \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"jsonrpc": "2.0",
"method": "eth_subscribe",
"params": ["syncing", null],
"id": "getblock.io"}'


Response

{
    "id": "getblock.io",
    "jsonrpc": "2.0",
    "result": "0xe2ffeb2703bcf602d42922385829ce96"
}