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

Best Answer

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

    image

    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'}) 

    image

    I hope this can help

Answers

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

    image

    I hope this can help.

  • Dear Jason.

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

    Best

    Filipe

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

    image

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


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



  • Hello.

    Any thoughts on the above inquiry?

    Thank you in advance.

    Best

    FJ

  • Extremely helpful. Thank you!