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


Shenzhen Code: 133275;

Bond info: Bond name, ISIN, Current Coupon, Coupon Type, Maturity Date and etc.

20230811120957.png



Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    @xuke

    Thank you for reaching out to us.

    For this code, you can also use Refinitiv Data Library to search for RIC of this code.

    df = rd.discovery.search(
        view = rd.discovery.Views.FIXED_INCOME_INSTRUMENTS,
        top = 10,
        filter = "LocalCodesLocalScheme  eq 'SHZ:133275'",
        select = "BusinessEntity,DocumentTitle, RIC, ISIN, MaturityDate,CouponType"
    )
    df

    1691745752230.png

    You can use the following code to get the list of fields in the FIXED_INCOME_INSTRUMENTS view.

    from refinitiv.data.content import search
    response = search.metadata.Definition(
        view = search.Views.FIXED_INCOME_INSTRUMENTS  
    ).get_data()


    response.data.df

    1691745838168.png

Answers

  • @Jirapongse Thanks for your reply.

    I found that the filter "filter = "LocalCodesLocalScheme eq 'SHZ:133275'"" is different from "filter = "(LocalCode eq '175143')"". Is there a common filter to search for and is suitable for all different regions in the world?

  • @xuke

    My colleague @marcin.bunkowski01 found out that we can use these codes directly with the get_data method to get bond information. For example:

    rd.get_data(['133275','175143'],['TR.FIIssuerName','TR.FIMaturityDate','TR.FICouponType','TR.FICouponTypeDescription'])

    The output is:

    1692068449951.png

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

  • @Jirapongse we tried the bond code="123205", and we cannot use rd.get_data method to get the RIC code. it returns empty. Please help to find the reason, thank you.

  • Please try the TR.PreferredRIC field.

    rd.get_data(['133275','175143','123205'],
                ['TR.FIIssuerName','TR.FIMaturityDate','TR.FICouponType','TR.FICouponTypeDescription','TR.PreferredRIC'])

    1692085233160.png

  • @Jirapongse Could we use this method to search for fund and stock RIC code?

    e.g. fund code: China Code FE = '006038' ;

    (detailed information: RIC code= 'LP68497266')

    stock code:301048;

    (detailed information: RIC code= '301048.SZ')

    I cannot attach the pictures on the comment. So I write the ric code for your reference.

  • @xuke

    I tired several fields that can provide RICs.

    rd.get_data(['133275','175143','123205','006038','301048'],
                ['TR.FIIssuerName','TR.FIMaturityDate','TR.FICouponType','TR.FICouponTypeDescription',
                 'TR.PreferredRIC','TR.RIC','TR.LipperRICCode','TR.PrimaryIssueRICCode','TR.FundHoldingRIC'])

    The output is:

    1692091793696.png

    You can contact the Eikon Excel support team directly via MyRefinitiv and ask for fields that can provide the required data. Typically, the fields used with the TR function in Eikon Excel can also be used with the get_data method.

  • @Jirapongse thanks, that works.

    I'd like to ask another questiones.

    1. Could we use rd.ger_data method to get the ric code for the type of fund asset? E.g. China Code EF = '006038'?

    image

    image

  • 2. Could we use rd.ger_data method to get the ric code for the type of stock asset? E.g. Stock code = '301048'?

    image

  • @Jirapongse sorry to bother you again. Since we don't have the license to retrieve the real time data, we cannot use the TR function.

    And I find that the result of the fond asset "006038" is not the asset we want. TR.FundName should be 'Dacheng JingHeng Mixed Fund C'.

    Does this mean we cannot use '006038' code to retrieve data?

  • In this case, you can get a RIC from search.

    df = rd.discovery.search(
        view = rd.discovery.Views.FUND_QUOTES,
        top = 10,
        filter = "LocalFundCode eq '006038'",
        select = "BusinessEntity,DocumentTitle, RIC,LocalFundCode"
    )
    df

    1692098850794.png

  • @Jirapongse Thanks for your reply. How to search the multiple code by using this search function? E.g. '006038', '012728'.

  • @xuke
    You can use the 'or' or 'in' operator.

    df = rd.discovery.search(
        view = rd.discovery.Views.FUND_QUOTES,
        top = 10,
        filter = "LocalFundCode in ('006038' '012728')",
        select = "BusinessEntity,DocumentTitle, RIC,LocalFundCode"
    )
    df
    df = rd.discovery.search(
    view = rd.discovery.Views.FUND_QUOTES,
    top = 10,
    filter = "LocalFundCode eq '006038' or LocalFundCode eq '012728'",
    select = "BusinessEntity,DocumentTitle, RIC,LocalFundCode"
    )
    df