How to use Eikon API to get the bond ric code?

I am using Eikon API to get bond RIC code via ISIN code.

I got the correct result for some ISIN codes ( XS2599899064, XS2650765725, XS2657056268),

But for several ISIN codes (XS2506532980, SGXZ38592606, XS2507733231, XS2544098127, XS2618052513,SGXZ84200740,XS2649260333), got nothing.

Can you give some advice? Thanks.


// Eikon Python API

import eikon as ek

ek.set_app_key('-------------key----------------')

data= ek.get_data( instruments=["XS2599899064", "XS2506532980","SGXZ38592606"], fields=[ "TR.RICCode",])

Best Answer

  • aramyan.h
    Answer ✓

    Hi @anchu ,


    You can use get_symbology function from Eikon convert ISIN to RIC as shown below:


    ek.get_symbology(["XS2506532980", "SGXZ38592606", "XS2507733231", "XS2544098127", "XS2618052513","SGXZ84200740","XS2649260333"])

    screenshot-2024-04-29-at-111754.png

    You can additionally provide paramaters for from_symbol_type and to_from_symbol_type if you want to specify one.

        from_symbol_type='ISIN',
    to_symbol_type='RIC'


    As you can see from the output above, some of the ISIN doesn't seem to have RIC and I would suggest raising a content query via my.refinitiv.com or Workspace Help&Support section via LSEG Workspace.


    As it comes to historical OHLC data you can use the get_timeseries function below:

    data= ek.get_timeseries(["XS2650765725=CGSP", "XS2627692085=SGEP","XS2618052513=UBSL"], start_date = '2020-01-01', end_date = '2024-04-28')
    data

    screenshot-2024-04-29-at-112145.png

    Here also, you may see NA for one of the instruments about which you can again ask the content team.


    Hope this is helpful.


    Best regards,

    Haykaz

Answers

  • Another question, I want to get the open and close price via RIC code, but it failed.

    How can I get the price via Eikon API?


    // Eikon Python API

    import eikon as ek

    ek.set_app_key('-------------key----------------')

    data= ek.get_data( instruments=["XS2650765725=CGSP", "XS2627692085=SGEP","XS2618052513=UBSL"], fields=[ "TR.RICCode",
    "CF_NAME",
    "CF_CURR",
    "CF_DATE",
    "CF_TIME",
    "OPEN_PRC",
    "HST_CLOSE",
    "CF_CLOSE",])