How to get ISIN and RIC for a corresponding Bond ISIN using python Data API ?

Hi, I am trying to get ISIN and RIC for a given Bond ISIN using python Data API. If i pass list of Bond ISIN to get_data() call, i am not getting the RIC or ISINs. Could you let me know how to use the "TR.FiParentImmedOrgID" field in python Data API as this field is used in excel plugin to get the ISIN and RIC for a given bond isin

Excel Formula:

=(TR(TR("US09659CMB18","TR.FiParentImmedOrgID"),"TR.ISIN;TR.RIC","NULL=BLANK")

Python Code Example,

df2,err = ek.get_data(instruments=bond_isin_list, #fields= ['TR.FiParentImmedOrgID','TR.ISIN','TR.RIC','TR.CompanyName'], raw_output=False)

Best Answer

  • @uma, you can achieve this with two consecutive calls (one: get an OrgID for each instrument, two: get a RIC for each OrgID) and merge the results.

    df, e = tr.get_data(['US037833CN89', 'US02079KAC18', 'USU02320AH94'],['TR.FiParentImmedOrgID'])

    df2, e = tr.get_data(df['Parent Immed Org ID'].astype(str).tolist(), ['TR.RIC'])

    df.set_index('Parent Immed Org ID', inplace=True)
    df2.set_index('Instrument', inplace=True)
    df.join(df2)

    This will output something like this:

    image

Answers

  • Thank you so much. This is what i require and worked perfectly.