Retrieves Robert Shiller’s monthly US stock market data from 1871, the data behind “Irrational Exuberance” and the CAPE ratio: the S&P Composite price, dividends and earnings, the consumer price index, the long-term interest rate, the same in real (inflation-adjusted) terms, and the cyclically adjusted price-earnings ratio (CAPE), the price over the average of ten years of real earnings. With more than 150 years of history it is the standard source for long-run equity returns, valuations and their relation to subsequent returns.

Prices are monthly averages of daily closes; dividends and earnings are trailing twelve-month totals, with the latest months not yet published. The long interest rate is a decimal fraction (0.0475 for 4.75%).

Shiller, R. J. (2015). Irrational Exuberance (3rd ed.). Princeton University Press.

No API key is needed.

See definition: https://shillerdata.com/

Also known as: Shiller data, CAPE, Shiller PE, long-run stock returns.

Shiller Stock Market Data in Python

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_shiller_stock_market_data as shown below.

from financetoolkit import Economics

economics = Economics(start_date='2026-01-01')

economics.get_shiller_stock_market_data()[['Price', 'Dividend', 'Earnings', 'CAPE']]

Which returns:

  Price Dividend Earnings CAPE
2026-01 6929.12 79.8018 247.664 39.6408
2026-02 6893.81 80.0835 254.693 39.014
2026-03 6654.42 80.3653 261.723 37.0316
2026-04 6957.01 80.8113 272.945 38.1383
2026-05 7412.55 81.2572 284.166 40.1014
2026-06 7450.03 81.7032 295.388 40.1502
2026-07 7481.34 nan nan 40.0086
2026-08 7711.32 nan nan 40.9874
2026-09 7669.41 nan nan 40.5809
2026-10 7722.72 nan nan 40.7106

Parameters

The function accepts the following parameters:

  • rounding (int | None, optional): The number of decimals to round the results to. Defaults to None.
  • growth (bool, optional): Whether to return the growth data or the actual data. Defaults to False.
  • lag (int, optional): The number of periods to lag the growth data by. Defaults to 1.
  • standardize (bool, optional): Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.
Share