Using websocket how to Fetch options chains/data

HI

using websocket API is there a way how to Fetch options chains/data . What should be the request Key

Example for spx options : ""0#SPX*.U" ,I need to extract following fields [DSPLY_NAME","UNDERLYING","EXPIR_DATE","STRIKE_PRC","PUTCALLIND","PUT_CALL","OPINT_1"]

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @bopanna.alemada

    If you want those specific fields, you can use the WebSocket View feature to set only interested in a subset of the fields in the "View" attribute of the JSON request message as follows:

    {
        'ID': 2,
        'Key': {
            'Name': ['0#SPX*.U'],
            'Service': 'ServiceName'
        },
        'View': [
            'DSPLY_NAME', 'UNDERLYING', 'EXPIR_DATE', 'STRIKE_PRC', 'PUT_CALL', 'OPINT_1'
        ]
    }

    If you want to get the Chain's RICs and their data, you need to get a list of RICs from the chain record, then manually subscribe to each RIC data.

    03-chaindatastructure-1.png

    You can find more detail in the following resources:

    Hope this helps.



Answers