question

Upvotes
Accepted
1 0 0 0

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"]

websocketschain-ric
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
16.8k 31 9 12

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.




icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 0 0 0

Thank you @wasin.w .

Let me go trough the samples

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.