For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

  1. Log in to your GetBlock account.

  2. 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:

Network
WebSocket 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:

Goal
Topic
Filters

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.

You pay for every event delivered after filtering. A subscription with no filters on a busy topic such as erc20Transfers delivers every transfer on the network. Start narrow.

4. Connect and subscribe

Authenticate with an Authorization: Bearer header, then send getblock_subscribe with one request object.

Connecting from a browser? Browser WebSocket APIs cannot set headers, so append the key instead: …/eth-mainnet/stream?apiKey=<API-KEY>. Keep query-string keys out of logs.

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?