Calculate the earnings yield ratio, a valuation ratio that measures the earnings per share relative to the market price per share.

The earnings yield ratio is a valuation metric that provides insights into how much a company’s earnings contribute to its stock price. It compares the earnings per share to the market price per share, helping investors understand the earnings potential of the company relative to its current market value

The formula is as follows:

\[\text{Earnings Yield Ratio} = \text{Earnings per Share} / \text{Share Price}\]

Also known as: E/P ratio, inverse PE ratio.

No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the Earnings Yield for you. Just ask in plain English.

Calculate the Earnings Yield in Python

The Earnings Yield is available in the Ratios module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_earnings_yield as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(["AAPL", "TSLA"], api_key="FINANCIAL_MODELING_PREP_KEY")

earnings_yield_ratio = toolkit.ratios.get_earnings_yield()

Which returns:

  2021 2022 2023 2024 2025
AAPL 0.0316 0.047 0.0319 0.0243 0.0275
TSLA 0.0046 0.0294 0.0173 0.005 0.0024

Parameters

get_earnings_yield accepts the following parameters:

  • show_daily (bool, optional): Whether to show daily data. Defaults to False.
  • include_dividends (bool, optional): Whether to include dividends in the calculation. Defaults to False.
  • diluted (bool, optional): Whether to use diluted shares in the calculation. Defaults to True.
  • rounding (int, optional): The number of decimals to round the results to. Defaults to 4.
  • growth (bool, optional): Whether to calculate the growth of the ratios. Defaults to False.
  • lag (int | str, optional): The lag to use for the growth calculation. 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.
  • trailing (int): Defines whether to select a trailing period. E.g. when selecting 4 with quarterly data, the TTM is calculated.

The Ratios module page introduces the module, and the sidebar lists all of its functions.

Share