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?


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.

| improve this answer | |
  • Thanks. What I ended up doing was pulling the S&P 100 into a spreadsheet from Yahoo. I calculate an evenly weighted average of those P/E ratios and that gives me some barometer of the market. – Justin Putney Mar 15 '12 at 4:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.