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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
38 2 1 0

Get EPS historical data for stocks

Hello.

I'm trying to retrieve the historical quarterly earnings per share (EPS), - the exact earnings annoument dates and values - for US stocks (let's say google) by using the python eikon API.

I'm having some issues to find a solution for this (i also used the eikon python formula creator as support but i didn't manage to find a solution).

So far I could only get what i guess it's the latest quarterly EPS. (example for google)

df,e = ek.get_data('GOOG.O',['EARNINGS'])

I've also not managed to attached a date to the EPS, much less the entire historical timeseries.

Many thanks in advance.

Best regards

Filipe

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythondatahistorical
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
6.7k 8 6 7

@f.janeiro So the parameters settings are available in the Data Item Browser tool - see below:

So the Period is the financial period referred to FY0 is the most recent actual, FY1 is the first year forecast (where the field are forward looking as in estimates), and FY-1 is the previous year actual etc. The period parameter can accept absolute as well as relative references including specific dates.

Frequency is the frequency of observation so FY is fiscal year, FQ is fiscal quarter, and then there are also CY for Calender Year etc More information is available in the data item browser tool.

So to look at quarterly data you need to be selecting a period of FQ0 and a frequency of FQ - to get the last 5 quarters just specify -5 in the EDate parameter which understands that you want -5 FQ as you have a frequency of FQ:

df2,e = ek.get_data('GOOGL.O',['TR.RevenueActValue.date','TR.RevenueActValue','TR.EPSActValue'],parameters = {'SDate':'0','EDate':'-5','Period':'FQ0','Frq':'FQ'}) 

I hope this can help


1614186309412.png (304.3 KiB)
1614259926097.png (79.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.

Upvotes
6.7k 8 6 7

@f.janeiro Please see the code below. You can use the Data Item Browser app to discover all the fields and parameters you can use (type DIB into eikon search bar).

df2,e = ek.get_data('GOOGL.O',['TR.RevenueActValue.date','TR.RevenueActValue','TR.EPSActValue'],parameters = {'SDate':'0','EDate':'-5','Period':'FY0','Frq':'FY'}) 

df2

I hope this can help.


1613572388162.png (93.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.

Upvote
38 2 1 0

Dear Jason.

Thank you for such a quick reply. It works and also thank you for the DIB tip. Seems quite useful.

Best

Filipe

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
6.7k 8 6 7

@f.janeiro my pleasure! Those are for the actuals - but we also provide consensus IBES estimates for these things as well - check out these as well as these are updated much more frequently (whenever any analyst changes or confirms their forecasts) - obviously there are also many more estimate fields you can request - these can provide a more responsive series - and are followed by many market participants.

df5, err =ek.get_data(['VOD.L'],['TR.RevenueMean(Period=FY1).calcdate',
                                 'TR.RevenueMean(Period=FY1)',
                                 'TR.RevenueNumIncEstimates(Period=FY1)',
                                 'TR.GrossIncomeMean(Period=FY1)',
                                 'TR.GrossIncomeNumIncEstimates(Period=FY1)',
                                 'TR.PreTaxProfitMean(Period=FY1)',
                                 'TR.PreTaxProfitNumIncEstimates(Period=FY1)',
                                 'TR.NetProfitMean(Period=FY1)',
                                 'TR.NetProfitNumIncEstimates(Period=FY1)',
                                 'TR.EPSMean(Period=FY1)',
                                 'TR.EPSNumIncEstimates(Period=FY1)',
                                 'TR.DPSMean(Period=FY1)',
                                 'TR.DPSNumIncEstimates(Period=FY1)',
                                 'TR.CLOSEPRICE(Adjusted=1)'],
                                 {'SDate':'-2000','EDate':'0', 'Frq':'D'})
                      
df5

I hope this can help. I am also about to publish an article on this area soon so keep an eye out for that.



1613613051616.png (313.9 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.

Upvotes
38 2 1 0

@jason.ramchandani Thank you for the extra details. I'm having a bit of troubles to get details on how to use the "parameters" field. I tried to check the documentation in the help(ek.get_data) but I'm still having problems on this, especially with the data frequency.

parameters = {'SDate':'0','EDate':'-5','Period':'FY0','Frq':'FY'}


In your code i get the actual earnings beginning of the year. How do I change the the frequency to get the quarterly actual earnings? Companies report earnings quartely if I'm not mistake and I would like to get that data.

df2,e = ek.get_data('GOOGL.O',['TR.RevenueActValue.date','TR.RevenueActValue','TR.EPSActValue'],parameters = {'SDate':'0','EDate':'-5','Period':'FY0','Frq':'FY'}) 

Regarding your second post, the "Period=FY1" argument is what makes the data forward looking, right?

So, in your fetching, when I see that earning per share is 0.0753 on the 2021-02-18, does it mean that this is what the analysts foresee as EPS in the next quarter earnings report or in one year from today?


Thank you in advance for your help.


Best

Filipe



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
38 2 1 0

Hello.

Any thoughts on the above inquiry?

Thank you in advance.

Best

FJ

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
38 2 1 0

Extremely helpful. Thank you!

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.

Click below to post an Idea Post Idea