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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
7 2 1 3

How to get Eikon data on python for a set of RICs given in excel sheet?

Hi, I have a list of RICs in a CSV file. I need to read these RICs and then get data such as PE ratio, EBITDA etc. for them all for a particular year. Essentially I need a dataframe for 2017 that has and EBITDA and PE data for all these RICs, then a dataframe for 2016 that has EBITDA and PE data for all these RICs and so on. Can someone please suggest a solution?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonrics
icon clock
10 |1500

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

Upvotes
Accepted
4.6k 26 7 22

@deepika.naga.k, here is a code sample that can help.

df, e = ek.get_data(['AAPL.O', 'GOOG.O'], 
                    ['TR.EBITDA.fperiod','TR.EBITDA(Scale=3)', 'TR.HistPE'], 
                    {'Frq':'FY', 'Period':'FY0', 'SDate':'-2', 'EDate':'0',
                    'Curn':'USD'})


icon clock
10 |1500

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

Upvotes
7 2 1 3

Thanks very much Zhenya Kovalyov. Would you be aware of a way I can access 'AAPL.O', 'GOOG.O' from a csv file in this code here? I have about 5000 RICs in a csv file and its painstaking to manually add them all to the code here.

icon clock
10 |1500

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

@deepika.naga.k
This question is about general programming in Python. It's not specific to the use of Refinitiv APIs. You can utilize countless resources on the Internet to find the answer to this question. One way of doing this would be to use read_csv method of pandas library to load the content of a csv file into a pandas dataframe. Then you can use tolist() method to convert series to a list. See for example this thread on Stackoverflow. The list can then be used in get_data method of eikon library. You may need to slice the list, as 5K RICs may be too many for a single request.

Click below to post an Idea Post Idea