question

Upvotes
Accepted
3 0 1 2

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.

Hi @bopanna.alemada,

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.


Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS


Upvotes
Accepted
24.6k 54 17 14

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
3 0 1 2

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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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