WebSocket reference

Connection and authorization

Authorization takes place when connecting to the WebSocket by passing the apikey parameter:

 

Limits

  • You're permitted up to 5 active connections for each dataset.
  • Each connection can handle up to 100 event messages every minute.
  • The maximum size for an event message is set at 100kb.
  • There's no cap on the number of tickers you can subscribe to, unless you set a specific limit during configuration.

If your application requires higher limits, you may reach out to our support.

Subscribe

To subscribe to 1min candle updates within a minute (time_series), you can use the following configuration:

Options

frequency

string

Accepts 1s, 10s, and 1m options. Data will stream at 1-second, 10-second, or 1-minute intervals accordingly.

aggregation

string

Accepts 1m option. Data will stream 1-minute bars.

channel

string

Accepts bars option. Data will stream as bars (candles).

publisher

string

Filter by Finazon's publisher code

tickers

array

Subscribe to an array of ticker symbols. Possible options: sip, binance

Event

{
  "event": "subscribe",
  "publisher": "sip",
  "tickers": ["AAPL","TSLA"],
  "channel": "bars",
  "frequency": "1s",
  "aggregation": "1m"
}

Subscribe success

{
  "status": "success",
  "code": "SUCCESS_SUBSCRIPTION",
  "data": {
    "event": "subscribe",
    "publisher": "sip",
    "mic": "",
    "market": "",
    "channel": "bars",
    "frequency": "1s",
    "aggregation": "1m",
    "tickers": [ "AAPL", "TSLA" ]
  }
}

Candle update

{
  "p": "sip",
  "ch": "bars",
  "f": "1s",
  "aggr":" 1m",
  "s": "TSLA",
  "t": 1699540020,
  "o": 220.06,
  "h": 220.13,
  "l": 219.92,
  "c": 219.96,
  "v": 4572
}

Unsubscribe

To unsubscribe from a channel, you can use the following configuration:

Event

{
  "event": "unsubscribe",
  "publisher": "binance",
  "tickers": ["BTC/USDT"],
  "channel": "bars",
  "frequency": "1s",
  "aggregation": "1m"
}

Unsubscribe success

{
  "status": "success",
  "code": "SUCCESS_UNSUBSCRIPTION",
  "data": {
    "event": "unsubscribe",
    "publisher": "binance",
    "mic": "",
    "market": "",
    "channel": "bars",
    "frequency": "1s",
    "aggregation": "1m",
    "tickers": [ "BTC/USDT" ]
  }
}