Welcome to the Forum

Creating an account is currently only possible via registration at SimFin.

Calculating historical P/E ratio is impossible with current API

I'm trying to calculate what the the P/E ratio for a company was 5 years ago.

I can use the API to get the price for a company on the date that I want, and this price is adjusted for splits so that there are no jumps in the price.

However, if I use the API to get the earnings per share on the same date, the data is not adjusted for splits, so there is no way to use the price and eps together to calculate the P/E ratio.

Could SimFin supply a means to get the historic price unadjusted for splits? This seems to me to be a really fundamental problem with the service, since P/E ratio is such an important indicator.

Thank you so much for providing this service, I can tell a lot of work went into it and I think it will help a lot of people


  • edited April 2019
    Hi zkreiser,
    shares outstanding (so EPS, too) should normally be adjusted for splits as well, can you tell me the company/period you are referring to or just post the API call?
  • Hi Thomas -

    I can confirm the problem that zkreiser is reporting: it appears that 'Common Shares Outstanding' does NOT appear to be adjusted for splits; and neither is 'Avg. Basic Shares Outstanding', nor 'Avg. Diluted Shares Outstanding'.

    As a quick example, check out AAPL. There was a 7-for-1 split on 2014-06-09. If you look at any of those 3 metrics referring to # shares, there is a big jump in values around then. If it were retroactively adjusted, then, similar to stock price, it should be a relatively smooth continuation of values.

    You can also check out PRPO, but the values there are even weirder. There was a 1-for-12 reverse stock split on 2014-01-28. There are almost no records under 'Common Shares Outstanding'; and the values for both 'Avg. Basic Shares Outstanding' and 'Avg. Diluted Shares Outstanding' show big jumps consistent with an unadjusted number of shares due to the reverse stock split (although for some reason, the changes in SimFin occur around 2013-01-01, not 2014-01-28).

    I think it's a pretty significant problem - it does seem to prevent an accurate calculation of daily market capitalization, which of course most valuation metrics depend on.

  • As you had mentioned in another post, does this come down to getting better source for Common Shares & Share Price data? Both of these seem to suffer some inconsistencies in historical adjustments after stock splits (Common Shares more problematic than Share Price, though both have issues).
  • ok thx, I'll check again then. The adjustment for stock splits problematic and the quality of the shares outstanding figures are 2 separate problems. I had implemented the adjustment for stock splits a while ago but I'll check it again now.
  • awesome thanks Thomas!
  • edited April 2019
    ok, there was a bug on data updates that caused the share split adjustments to be ignored for shares outstanding. It's fixed now. I updated Apple now (online, so the API should show it, bulk download not yet, will recompile in the next couple of days) and all other companies are being updated too now.

    Thanks for reporting.
  • awesome thank you! will anxiously await the bulk download haha. i'll continue to report if any other things noted.

    btw, this will be a huge fix, functionally speaking. it makes all the valuation stuff possible!
  • hi thomas! do you know when the next bulk download will be created? wanted to check out the updates.
  • I agree that this is an important fix. Curious to investigate on new bulk data. Thanks Thomas!
  • We were updating the server a few times in the last days so I'll launch the bulk update tomorrow finally, sorry for the delay.
  • awesome ... will check it out!
  • Hi Thomas, just FYI, the unzipped CSV file of fundamentals (detailed) + share prices is now 750MB, which is suddenly over 2x the size of the Feb bulk download. Just alerting you in case it's a flag for some simple error!
  • ok interesting, I didn't change anything though on the bulk download compilation script! If you notice something strange, please notify me.
This discussion has been closed.