How to extract the data from web-socket message?

Darchitect
Hi,
Could you provide any working example for how to extract trade data from web socket response?
Suppose I want to extract last trade price how can i get that?

my code example.

var ws = new WebSocket("wss://ws.kite.trade?api_key=xxxxxxxx&access_token=xxxxxxx");
var message = {"a": "subscribe", "v": [408065]};

ws.onopen = () => {
ws.send(JSON.stringify(message));
};

ws.onmessage = (msg) => {
console.log(msg.data);
};

//Here I am getting blog as msg.data and I can not see any information about trading symbol.

If you could provide a small working example using javascript it will be better.
Sign In or Register to comment.