Get all futures contracts from ticker or isin

Hi all,


I'm trying to find the query to get all futures contract info from the underlying isin / ticker.


More specifically, i would like to input the isin/ticker of a security and get all the futures contract on that security. The final goal of this would be to get the RIC code of these contracts.


Does anyone have an idea ?


Thanks,

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @adam.leroux

    Thank you for reaching out to us.

    I can search all future RICs with an organization PermID by using the Refinitiv Data Library for Python.

    First, I need to find an organizarion PermID for an ISIN.

    df = rd.get_data(universe=['US02079K1079'],fields=['TR.OrganizationID'])
    df

    1715743693336.png

    Then, use the Organization PermID to search for future RICs.

    df1 = rd.discovery.search(
        view=rd.discovery.Views.EQUITY_QUOTES,
        select="DocumentTitle,RIC,UnderlyingQuoteRIC,DerivedCategory,AssetState", 
        filter=f"UnderlyingIssuerOAPermID eq '{df['Organization PermID'][0]}' and DerivedCategory eq 'FUTURE' and AssetState eq 'AC' and IsChain eq false",
        top=10000
    )
    df1

    1715743924034.png

    The samples are on GitHub. For more information regarding the search API, please refer to the Building Search into your Application Workflow article.

Answers