Getting Datastream Code(DSCD) using LSEG Data Library

I'm working on an assginment that need index constituents' dscode for future references, by far I only found that we need to use datastream web service api to retrieve the dscodes of companies. I'm wondering if we can use the new LSEG data library in python to get it?

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @lixiong.he.2024

    Thank you for reaching out to us.

    LSEG Data Library can't connect to the Datastream WebService but it can convert RICs to DSCDs by using search.lookup. The example is on GitHub.

    response = search.lookup.Definition(
        view=search.Views.SEARCH_ALL,                               # Required parameter
        scope="RIC",                                                       # Required parameter
        terms="MSFT.O,AAPL.O,GOOG.O,IBM.N,KBANK.BK,SCC.BK",                # Required parameter
        select="BusinessEntity,DocumentTitle,DsQuotationNumber",                 # Required parameter
    ).get_data()


    response.data.df

    The output is:

    1728534341978.png


Answers