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"

])

Best Answer

  • Jirapongse
    Answer ✓

    @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

Answers

  • 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

  • @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).

  • @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.

  • @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