question

Upvotes
Accepted
1 0 1 4

getting option chain for given stock datastream mnemonic using pydatastream API

Hi,


I am using the pydatastream package to query some data. I have a list of datastream mnemonics for stocks, such as @AAPL. How can I get the mnemonic of the chain of options that trades on AAPL? In this specific case I can find it through the DFO navigator, where for example the chain for live AAPL calls is LOPTAAQ$LC, but I am looking for a way to do this programmatically for many stocks.

pythondatastream-apidatastream
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.

Hello @abdiat

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

1 Answer

· Write an Answer
Upvotes
Accepted
79.1k 250 52 74

@abdiat

You can contact the Refinitiv Datastream Web Service support team directly via MyRefinitiv to verify if there is a data type (field) that can provide this options list code. If the data type is available, you can retrieve it via the get_data method.

However, I found the Datastream Options User Companion guide that explains the format of the options list code.

1660793831667.png

Moroever, you can use the search functionality in the API to search for this code.

For example:

df1 = ds.get_data(tickers="Apple Live", fields=["DS.SYMBOLLOOKUP(Count=50)"],  kind=0)

The output is:

1660794213127.png

Then, look for the Instruments that start with LOPT. However, this method may not work for all cases.

The best method to contact the Refinitiv Datastream Web Service support team to verify if there is a way to retrieve the Opions List via the API.



1660793831667.png (52.8 KiB)
1660794213127.png (24.5 KiB)
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.