8

Or CAPE ratio?

I would love to be able to pull the current P/E ratio for the S&P 500 into a spreadsheet, for example.

Neither the Google or Yahoo APIs have a P/E ratio associated with indices.

Any ideas?

Justin Putney
  • 181
  • 1
  • 4

1 Answers1

5

I don't know of any free APIs (which I assume you are looking for) that do the pre-calculation of that for you. In Robert Shiller's book Irrational Exuberence he referenced data available on his website (here: http://www.econ.yale.edu/~shiller/data.htm), but it is not comprehensive or up to date.

You could however, using any APIs for individual stocks, calculate it for short periods of time. You would need to know the index members, their respective weights, and then fetch historical prices and earnings.

There are plenty of paid sources of this data. Xignite APIs could be used to get the core data pretty easily. And in the past http://www.valueline.com has done this calculation for me, for a charge.

PJunior
  • 103
  • 3
Alex Opposite
  • 426
  • 2
  • 6