WebSocket Data Decoding

kartik.trade
Any body decoded full quotes data using JavaScript and Php.
I request to please share code.
  • raghu
    Hi,
    I have a question regarding parsing of the websocket response
    I set up and send the following json message
    {"a": "subscribe", "v": [408065,884737]}
    and interpreted the series of messages as
    int16, int16, int32, int32, int32, int32,int32,int32
    the response interpreted is as follows
    0 2 0 44 0 6 58 1

    I am not able to figure out what this means?
    any ideas?
  • Vivek
    @kartik.trade @raghu Here is a python function for parsing binary data from websocket - https://github.com/rainmattertech/pykiteconnect/blob/master/kiteconnect/__init__.py#L831

    You can safely ignore if the response type is text not binary or binary data length is less than 8. Here is the text from documentation.
    ltp LTP. Packet contains only the last traded price (8 bytes).
    quote Quote. Packet contains several fields excluding market depth (44 bytes).
    full Full. Packet contains several fields including market depth (164 bytes).
    For binary message structure please refer documentation - https://kite.trade/docs/connect/v1/#message-structure
Sign In or Register to comment.