Skip to main content

What you’ll do

  • Connect to wss://api.blockdb.io/v1/evm/
  • Authenticate with Authorization: Bearer <API_KEY> (or ?api_key= fallback)
  • Subscribe to a dataset (example: Blocks dataset_id: "0101")
  • Receive update messages
  • 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://api.blockdb.io/v1/evm/?api_key=YOUR_API_KEY

2) 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)
  • update messages (the live data)
subscribe_response (success)
update

4) Unsubscribe (client → server)

Unsubscribe stops a stream without closing the WebSocket.
unsubscribe_response (success):

Next steps

Last modified on April 6, 2026