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
Accepted
7 1 3 7

how to use Eikon API to get stock RIC code

Question:

1. We get a stock information: 600687.SS and how to use Eikon API to get stock RIC code?

We use Eikon desktop to find the RIC code is 600687.SS^C21. This is a delisted stock.

2. Could we use search function and how to write the statement? Thanks.


Python statement we used now:

data, err = ek.get_data(instruments=600687.SS, fields=[

"TR.RICCode",

"CF_NAME",

"DSPLY_NMLL",

"TR.IPODate",

"CF_CURR"

])

eikoneikon-data-apiworkspaceworkspace-data-apiapi#content
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
Accepted
80k 257 52 75

@joneliu

You can specify multiple RICs in the query with the OR operator. You need to specify the view to rd.discovery.Views.EQUITY_QUOTES.

df = rd.discovery.search(
    view=rd.discovery.Views.EQUITY_QUOTES,
    query="600687.SS OR 600688.SS",
    top=10,
    select="RIC,DocumentTitle,IPODate,OriginalRIC,QuoteCurrency,RCSCurrencyName,DocumentTitleZhHans,OldQuoteRICs"
)
df
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.

Upvote
5.6k 18 2 7

Hi @xuke ,


What about using the symbology function which will return available symbols for the instrument?

ek.get_symbology('600687.SS')

screenshot-2024-01-03-at-101849.png


Hope this helps.


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.

@aramyan.h

data1, err = ek.get_symbology(["600687.SS"], from_symbol_type="CUSIP", to_symbol_type="RIC")

error info:

get stock info exception: not enough values to unpack (expected 2, got 1)

which type should we use to "from_symbol_type" ?

@joneliu

It should be RIC.

data1 = ek.get_symbology(["600687.SS"], from_symbol_type="RIC", to_symbol_type="RIC")
data1

The ek.get_symbology method returns a value (data1), not a tuple (data1, err).

Upvotes
80k 257 52 75

@xuke

You, you can use the search methon in the Refinitiv Data Library for Python.

The code looks like this:

df = rd.discovery.search(
    view=rd.discovery.Views.SEARCH_ALL,
    query="600687.SS",
    top=10,
    select="RIC,DocumentTitle,IPODate,OriginalRIC,QuoteCurrency,RCSCurrencyName,DocumentTitleZhHans,OldQuoteRICs"
)

However, it doesn't return the IPO Date of 600687.SS.

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.

@Jirapongse

We want to query data in batches,Whether it is possible to have code to query data in batches?


why these infos existed when I want to get price?

1704871237334.png

1704871237334.png (56.7 KiB)

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.