Equity Option Chains Using Codebook

Trying to pull the full list of option contracts for a security such as Apple using the following:

chain = rd.get_data(

universe = ['0#/AAPL*.U'])

chain.T

This pulls approx 13 RICs under 'Instrument' LongLink. Is it possible to pull them all using just one chain in the query?

I note that the method that was used with eikon doesn't appear to work with rd.get_data. How can i achieve the same results? Thanks.

df, err = ek.get_data('0#/IBM*.U', ['CF_NAME', 'OPINT_1'])

Best Answer

  • @evanclark33 Thanks for your question - so I would use the Chain object - which is designed to decode all sorts of chains - to achieve this:

    import refinitiv.data as rd
    from refinitiv.data.discovery import Chain
    rd.open_session()
    aapl = Chain(name="0#AAPL*.U")
    print(len(aapl.constituents))

    1774

    aapl.contituents

    1690886692194.png

    So this is how I would do this to get all the options and then use them - or more likely - chunk them with downstream get_data or get_history functions to stay within per call data limits. I hope this can help.

Answers