Getting Started
Connect to GetBlock EVM Data Stream, open your first subscription, and handle live events in Node.js or Python.
This guide takes you from an API key to a running client that receives live ERC-20 transfers on Ethereum.
1. Get an API key
Log in to your GetBlock account.
Open Settings → API Keys and copy a key. Keys start with
gb_.
Data Stream is billed from your CU balance at 10 CU per delivered event, so make sure your account has CU available.
2. Choose a network
Each network has its own endpoint:
Ethereum Mainnet
wss://stream.eu-central-1.getblock.io/v1/eth-mainnet/stream
BNB Smart Chain
wss://stream.eu-central-1.getblock.io/v1/bsc-mainnet/stream
Polygon Mainnet
wss://stream.eu-central-1.getblock.io/v1/polygon-mainnet/stream
Robinhood Mainnet
wss://stream.eu-central-1.getblock.io/v1/robinhood-mainnet/stream
To use more than one network, open one connection per network.
3. Choose a topic and filters
A topic decides what kind of event you receive; filters narrow it down. For example:
New block headers
newHeads
none
USDT transfers into one wallet
erc20Transfers
tokenContract, to
Swap events from one pool, decoded
decodedLogs
abi, address
Failed transactions sent by your wallet
transactionReceipts
status: "failure", from
See API Reference → Topics for all 15 topics.
4. Connect and subscribe
Authenticate with an Authorization: Bearer header, then send getblock_subscribe with one request object.
5. Read the response
The first message is the subscription ID:
Each event then arrives as a notification. The payload sits in params.result.data:
eventId, removed, and revision are how the stream reports chain reorganizations. If you store events, key them by eventId.
6. Unsubscribe or disconnect
Cancel one subscription and keep the socket open:
Closing the socket ends all its subscriptions.
Production checklist
Last updated
Was this helpful?