Python: search directly by ISIN

Options

I want to be able to search directly by ISIN, as I will start out with only the ISIN available in python and not the Equity RIC. Is there a way via python to figure out the RIC and other features based on solely the ISIN?

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @julie.osial

    Thank you for reaching out to us.

    You can use the LSEG Data Library for Python to retrieve RICs from ISINs.

    There are several methods.

    1.Use the get_data method

    ld.get_data(
        universe = ["US4592001014","US30303M1027","US0231351067"],
        fields = ["TR.RIC"])
    

    image.png

    2. Use the symbol_conversion endpoint

    response = symbol_conversion.Definition(
        symbols = ["US4592001014","US30303M1027","US0231351067"],
        from_symbol_type = symbol_conversion.SymbolTypes.ISIN,
        to_symbol_types = [symbol_conversion.SymbolTypes.RIC]).get_data()
    response.data.df
    
    image.png

    3. Use the search.lookup endpoint

    symbols = ["US4592001014","US30303M1027","US0231351067"]
    response1 = search.lookup.Definition(
        view=search.Views.SEARCH_ALL,                              
        scope="ISIN",                                                  
        terms=",".join(symbols),
        select="RIC",               
    ).get_data()
    
    response1.data.df
    
    image.png

    You can refer to the example code on GitHub.

  • wasin.w
    wasin.w admin
    edited 4:34AM

    Hello @julie.osial

    You can use a Search feature on the https://developers.lseg.com/en/api-catalog/lseg-data-platform/lseg-data-library-for-python to find information you need.

    Example code:

    import lseg.data as ld
    from lseg.data.content import search

    ld.open_session()

    response = search.Definition(
    view=search.Views.SEARCH_ALL,
    select="ISIN,RIC,....",
    filter="ISIN eq '<ISIN Code>'" ←- Set your ISIN here
    ).get_data()
    response.data.df
    query.png

    You can find a full example here.