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.

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    @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.