Volmex offers both public and private websocket connections for real-time index data retrieval.
Public Websockets Realtime Data
const socket = io('wss://ws.volmex.finance', {transports: ['websocket']});
socket.on('connect', function () {
console.log('Connected');
socket.emit('fetch-indices-messages', {});
socket.on('indices-messages-stream', (data) => {
console.log(data);
});
});
Private Websockets Realtime Data
curl --request POST \
--url 'https://rest-v1.volmex.finance/auth/authorize' \
-d 'login=API_USER&password=API_PASSWORD'
const socket = io('wss://ws.volmex.finance', {transports: ['websocket'], query: {jwkToken: 'YOUR_JWT_TOKEN'});
socket.on('connect', function () {
console.log('Connected');
socket.emit('fetch-indices-messages-private', {});
socket.on('indices-messages-stream-private', (data) => {
console.log(data);
});
});