Quickstart Guide

Quickly establish a connection via websocket and start receiving streaming data and analytics.

Subscribing to the Endpoint

All subscriptions go through a single endpoint URL :

wss://pro.cryptostats.dev:8443/?options=:options

This endpoint is SSL encrypted and supported by a high capacity, low-latency C++ websocket implementation to reduce latency whilst maintaining security.

You can add your API key to gain access to your subscribed channels:

from websocket import create_connection
import urllib

options = {
    api_key: [YOUR_API_KEY],
    action: 'subscribe',
    channels: [YOUR_CHANNELS]
}

options_url = urllib.parse.urlencode(options)
url = f'wss://pro.cryptostats.dev:8443/?options={options_url}'
ws = create_connection(url)

Channel subscriptions can be passed as part of the options parameters or can be sent separately after connecting to the WebSocket.

Full Implementation

Below is a working implementation subscribing to normalized trades on the BTC-PERPETUAL instrument at deribit:

Live Runnable Example (Node.js)

Live Runnable Example (Python)

Last updated

Was this helpful?