Skip to main content
Amberdata’s WebSocket services provide real-time, low-latency data streaming across multiple blockchain and market data feeds. This guide will get you connected and subscribed quickly.

Quick Start

Prerequisites

  • Valid Amberdata API key
  • WebSocket client (we’ll use wscat for examples)

Installation

Your First Connection

Connect to Amberdata’s WebSocket endpoint with your API key:

Your First Subscription

Once connected, subscribe to block events:
Response:
You’ll now receive real-time trade events like this:

Connection Endpoints

Use the appropriate endpoint for optimal performance based on your data type:

Subscription Format

All subscription requests follow JSON-RPC 2.0 format:

Request Structure

Market Data Subscription Examples

Spot Market Data:
Multiple Instruments (make separate requests):
Exchange-wide Subscription (Spot only):

Supported Blockchains

For specifc blockchains, specify as a header in the initial HTTP upgrade request.

Unsubscribing

Stop receiving notifications by sending an unsubscribe request:
Response:

Authentication Errors

If your API key is invalid, you’ll receive this error and the connection will close:

Next Steps