Search code examples
pythonthomson-reuters-eikonrefinitiv-eikonrefinitiv-eikon-api

How to retrieve all associated company RICs for a specified exchange RIC using the Refinitiv Eikon API?


Using the Refinitiv (formerly known as Thomson Reuters ) Eikon Data API, does anyone know how to quickly return all associated company RICs for exchanges such as Oslo Stock Exchange?

The RIC for Oslo Stock Exchange seems to be .OSEBX

And eikon.get_data has a few examples in the docstring:

import eikon as ek
ek.set_app_key('set your app key here')
data, err = ek.get_data(["IBM", "GOOG.O", "MSFT.O"], ["TR.PriceClose", "TR.Volume", "TR.PriceLow"])
data, err = ek.get_data("IBM", ['TR.Employees', {'TR.GrossProfit':{'params':{'Scale': 6, 'Curn': 'EUR'},'sort_dir':'asc'}}])
fields = [ek.TR_Field('tr.revenue'),ek.TR_Field('tr.open',None,'asc',1),ek.TR_Field('TR.GrossProfit',{'Scale': 6, 'Curn': 'EUR'},'asc',0)]
data, err = ek.get_data(["IBM","MSFT.O"],fields)

So I've tried different variations with eikon.get_data(instruments = ".OSEBX", fields = "RIC"), but with no success.

Any suggestions?


Solution

  • You can use the chain (which always starts with 0#), like this:

    data, err = ek.get_data('0#.OSEBX', 'TR.CommonName')
    

    This will give you the RICs of all the companies in the index, plus their respective company names.