Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
9 1 1 6

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",])

pythonworkspace#technologyricsbondsisin
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
9 1 1 6

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",])


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
5.2k 16 2 7

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


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.