Getting Live Index Data

To get live data on any supported index, simply connect to the associated websocket listed below:

BTC = wss://btc.data.hxro.io/live
BNB = wss://bnb.live.hxro.io/live
ETH = wss://eth.live.hxro.io/live
US30 = wss://us30.dev.hxro.io:8083/live
USOIL = wss://usoil.dev.hxro.io:8083/live
GOLD = wss://gold.dev.hxro.io:8083/live

const WebSocket = require('ws');
var socket = new WebSocket('wss://btc.data.hxro.io/live');

socket.onmessage = function (event) {
    var message = event.data;
    console.log(JSON.parse(message));
};