If you are a Yahoo Finance Premium subscriber, you can combine the functionalities of the Research class (to find reports or sectors) and the Ticker class (to perform deep analysis on specific symbols) without needing to log in twice.
To do this, initialize a Research instance with your credentials, then pass the session and crumb attributes from that Research instance into the Ticker constructor. This allows the Ticker instance to reuse the authenticated session established by Research.
from yahooquery import Research, Ticker
# 1. Authenticate via Research
r = Research(username='username@yahoo.com', password='password')
# 2. Use Research to find data (e.g., reports)
df = r.reports(
sector='Financial Services',
report_date='Last Week',
investment_rating='Bullish',
report_type='Analyst Report'
)
# 3. Pass Research session and crumb to Ticker to reuse authentication
tickers = Ticker('aapl', session=r.session, crumb=r.crumb)
# Now 'tickers' can access premium data like p_company_360
data = tickers.p_company_360