how to use eikon api to get bond info via bond Shanghai code?

Bond Shanghai code : 175143

Tagged:

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @xuke

    Thank you for reaching out to us.

    From my test, it doesn't work with the Shanghai Code but it works with ISIN.

    You can use the Refinitiv Data Library to search for ISIN and then retrieve the data by using ISIN or RIC. The examples are available on GitHub. You can use the desktop.workspace session by setting the application key (app-key) in the refinitiv-data.config.json and setting the default session to "desktop.workspace".

    1. Search for ISIN or RIC from the Shanghai Code

    df = rd.discovery.search(
        view = rd.discovery.Views.FIXED_INCOME_INSTRUMENTS,
        top = 10,
        filter = "(LocalCode eq '175143')",
        select = "BusinessEntity,DocumentTitle, RIC, ISIN,LocalCode"
    )
    df

    1691742896753.png

    2. Use ISIN or RIC to get the data

    rd.get_data(df["RIC"][0],["TR.RIC","TR.FIIssuerName","TR.FIMaturityDate","TR.FICouponType"])

    1691742944691.png

    You can use the Data Item Browser tool to search for other fields.

Answers