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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 1 1

how to retrieve last 10 years Return On Invst Cap for a stock/equity via Python?

the circled values, would be great to indicate code to retrive these yearly values in a dataframe Thanks


Edit 07/04: Thanks @chavalit, your code works. I would be grateful to have the reply of 3 questions:

1. would need the same things for the below 5 numbers for last 10 years(yearly):

sales, EPS(earnings per share), equity(BVPS), (free) cash and total long-term debt

2. would be great to have several stocks for these values in the same df

3. Instead of replying Q1 and Q2, if there is online guide/tutorial which help me achieve above directly, it would be good too.




eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonequities
roic.jpg (87.3 KiB)
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.

Upvote
Accepted
18k 21 12 20

Hi @keyan.z

You can try this code:

df,e = ek.get_data('IBM.N',
                   ['TR.F.ReturnInvstCapPct.Date','TR.F.ReturnInvstCapPct'],
                   {'SDate':'0','EDate':'-9','Frq':'Y'})
df



ahs.png (28.4 KiB)
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.

Thanks your code works. I would be grateful to have the reply of 3 questions:

1. would need the same things for the below 5 yearly numbers for last 10 years

sales, EPS(earnings per share), equity(BVPS), (free) cash and total long-term debt

2. would be great to have several stocks for these values in the same df

3. Instead of replying Q1 and Q2, if there is online guide/tutorial which help me achieve above directly, it would be good too.

Upvote
18k 21 12 20

Hi @keyan.z

You can click on the ? icon to get to know the field name.


Once you know the field name, you can read this tutorial to use Formula Builder or Data Item Browser to see the field parameter.


If you cannot find the field you are interested in, you can contact Refinitiv Content Helpdesk.

From API perspective, if the data can be retrieved into Excel using =TR worksheet function, it can also be retrieved using Eikon Data APIs.

The Refinitiv Content Helpdesk can be reached using Contact Us capability in your Eikon application.
Or by calling the Helpdesk number in your country.
Or at https://my.refinitiv.com/


ahs1.png (212.8 KiB)
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.

Thanks, I started to search (total) sales but I only found "sales per employee", I am lost as I am not even sure it is in that initial table

Click below to post an Idea Post Idea