Skip to main content

groups

Get company data grouped by sector, industry or country and display either performance or valuation metrics.

Valuation metrics include price to earnings, price to book, price to sales ratios and price to cash flow. Performance metrics include the stock price change for different time periods.

Examples

from openbb import obb
obb.equity.compare.groups(provider='finviz')
# Group by sector and analyze valuation.
obb.equity.compare.groups(group='sector', metric='valuation', provider='finviz')
# Group by industry and analyze performance.
obb.equity.compare.groups(group='industry', metric='performance', provider='finviz')
# Group by country and analyze valuation.
obb.equity.compare.groups(group='country', metric='valuation', provider='finviz')

Parameters

NameTypeDescriptionDefaultOptional
groupstrThe group to compare - i.e., 'sector', 'industry', 'country'. Choices vary by provider.NoneTrue
metricstrThe type of metrics to compare - i.e, 'valuation', 'performance'. Choices vary by provider.NoneTrue

Returns

OBBject
results : List[CompareGroups]
Serializable results.

provider : Optional[Literal['finviz']]
Provider name.

warnings : Optional[List[Warning_]]
List of warnings.

chart : Optional[Chart]
Chart object.

extra : Dict[str, Any]
Extra info.

Data

NameTypeDescription
namestrName or label of the group.