What you’ll do
- Connect to
wss://stream.blockdb.io/v1/evm/ - Authenticate with
Authorization: Bearer <API_KEY>(or?api_key=fallback) - Subscribe to a dataset (example: Blocks
dataset_id: "0101") - Receive
updatemessages - Unsubscribe cleanly without closing the socket
Prerequisites
- A valid BlockDB API key (set as
BLOCKDB_API_KEY) - A WebSocket client (CLI or SDK)
1) Connect
If your client cannot send headers during the handshake, use the query parameter fallback:
wss://stream.blockdb.io/v1/evm/?api_key=YOUR_API_KEY2) Subscribe (client → server)
This starts a stream. You must provide:action: "subscribe"chain_id(EVM chain)dataset_id(stream dataset)params(stream-specific filters; use{}if none)
3) Handle messages (server → client)
After subscribing you will receive:subscribe_response(ack, success or error)updatemessages (the live data)
subscribe_response (success)
update
4) Unsubscribe (client → server)
Unsubscribe stops a stream without closing the WebSocket.Next steps
- Browse available streams: EVM Streams Overview
- Common error patterns and payload shape: Errors
- Reconnect strategy and timeouts: Connection Management