Industry P/E
Returns industry price-to-earnings (P/E) ratios. Provide exactly one of date (a snapshot across all industries on that date) or industry (the historical time series for one industry).
Also known as: industry P/E snapshot, industry P/E history, industry valuation trend.
Industry P/E in Python
get_industry_pe is part of the Discovery module of the open-source Finance Toolkit. Install it with:
pip install financetoolkit -U
Then call get_industry_pe as shown below.
from financetoolkit import Discovery
discovery = Discovery(api_key="FINANCIAL_MODELING_PREP_KEY")
industry_pe = discovery.get_industry_pe(date="2024-02-01")
industry_pe.head()
industry_pe_history = discovery.get_industry_pe(industry="Biotechnology")
industry_pe_history.tail()
Which returns:
| Industry | Date | Exchange | PE Ratio |
|---|---|---|---|
| Advertising Agencies | 2024-02-01 | NASDAQ | 71.0960 |
| Aerospace & Defense | 2024-02-01 | NASDAQ | 46.0186 |
| Agricultural Farm Products | 2024-02-01 | NASDAQ | 7.4529 |
| Agricultural Inputs | 2024-02-01 | NASDAQ | 58.9849 |
| Agricultural - Machinery | 2024-02-01 | NASDAQ | 10.3538 |
Parameters
get_industry_pe accepts the following parameters:
- date (str, optional): The date to retrieve a snapshot for, e.g. “2024-02-01”.
- industry (str, optional): The industry to retrieve the history for, e.g. “Biotechnology”.