API for retrieving index P/E ratio?
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?
1 Comments
Sorted by latest first Latest Oldest Best
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: 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 www.valueline.com has done this calculation for me, for a charge.
Terms of Use Privacy policy Contact About Cancellation policy © freshhoot.com2026 All Rights reserved.