Earnings Yield
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.
Earnings Yield in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_earnings_yield as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
["F", "GM", "TM"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.ratios.get_earnings_yield()
Or, after setting up the Finance Toolkit MCP, ask:
What earnings yields did Ford, General Motors and Toyota offer from 2021 to 2025?
Which returns:
| 2021 | 2022 | 2023 | 2024 | 2025 | |
|---|---|---|---|---|---|
| F | 0.2141 | -0.0424 | 0.0882 | 0.1477 | -0.1567 |
| GM | 0.1143 | 0.1823 | 0.2038 | 0.1195 | 0.0402 |
| TM | 0.0986 | 0.0971 | 0.1382 | 0.1225 | nan |
Parameters
get_earnings_yield accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
show_daily | bool | Whether to show daily values: the close of each trading day against the statement figures of the latest period that has ended on or before that day (also when it ended before the start date), so no figures are used before their period closes. Defaults to False. | True |
include_dividends | bool | Whether to deduct preferred dividends from net income. Defaults to False. | True |
diluted | bool | Whether to use diluted shares in the calculation. Defaults to True. | False |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
growth | bool | Whether to calculate the growth of the ratios. Defaults to False. | True |
lag | int | list[int] | The lag to use for the growth calculation. Defaults to 1. | 4 |
compound | bool | Whether the growth is the compound annual growth rate over the lag (e.g. lag=5 for the five-year CAGR) instead of the total change. Defaults to False. | False |
standardize | bool | Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. | True |
trailing | int | The number of periods to sum flows (income and cash flow statement items) over, with balance sheet items averaged over the same number of period ends. E.g. 4 with quarterly data gives the trailing twelve months (TTM) and 3 with annual data a three-year cumulative figure. Defaults to None, which uses the trailing twelve months (4 quarters) with quarterly data and single years with annual data. | 4 |