yahooquery Skill
Comprehensive access to Yahoo Finance data via the yahooquery Python library. This library provides programmatic access to nearly all Yahoo Finance endpoints, including real-time pricing, fundamentals, analyst estimates, options, news, and premium research.
Core Classes
1. Ticker (Company-Specific Data)
The primary interface for retrieving data about one or more securities.
from yahooquery import Ticker
# Single or multiple symbols
aapl = Ticker('AAPL')
tickers = Ticker('AAPL MSFT NVDA', asynchronous=True)
2. Screener (Predefined Stock Lists)
Access to pre-built screeners for discovering stocks by criteria.
from yahooquery import Screener
s = Screener()
screeners = s.available_screeners # List all available screeners
data = s.get_screeners(['day_gainers', 'most_actives'], count=10)
3. Research (Premium Subscription Required)
Access proprietary research reports and trade ideas.
from yahooquery import Research
r = Research(username='you@email.com', password='password')
reports = r.reports(report_type='Analyst Report', report_date='Last Week')
trades = r.trades(trend='Bullish', term='Short term')
Ticker Class: Data Modules
The Ticker class exposes dozens of data endpoints via properties and methods.
📊 Financial Statements
.income_statement(frequency='a', trailing=True) - Income statement (annual/quarterly)
.balance_sheet(frequency='a', trailing=True) - Balance sheet
.cash_flow(frequency='a', trailing=True) - Cash flow statement
.all_financial_data(frequency='a') - Combined financials + valuation measures
.valuation_measures - EV/EBITDA, P/E, P/B, P/S across periods
📈 Pricing & Market Data
.price - Current pricing, market cap, 52-week range
.history(period='1y', interval='1d', start=None, end=None) - Historical OHLC
- period:
1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max
- interval:
1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo
.option_chain - Full options chain (all expirations)
🔍 Analysis & Estimates
.calendar_events - Next earnings date, EPS/revenue estimates
.earning_history - Actual vs. estimated EPS (last 4 quarters)
.earnings - Historical quarterly/annual earnings and revenue
.earnings_trend - Analyst estimates for upcoming periods
.recommendation_trend - Buy/Sell/Hold rating changes over time
.gradings - Recent analyst upgrades/downgrades
🏢 Company Fundamentals
.asset_profile - Address, industry, sector, business summary, officers
.company_officers - Executives with compensation details
.summary_profile - Condensed company information
.key_stats - Forward P/E, profit margin, beta, shares outstanding
.financial_data - Financial KPIs (ROE, ROA, debt-to-equity, margins)
👥 Ownership & Governance
.insider_holders - List of insider holders and positions
.insider_transactions - Recent buy/sell transactions by insiders
.institution_ownership - Top institutional holders
.fund_ownership - Top mutual fund holders
.major_holders - Ownership summary (institutional %, insider %, float)
🌍 ESG & Ratings
.esg_scores - Environmental, Social, Governance scores and controversies
.recommendation_rating - Analyst consensus (Strong Buy → Strong Sell)
📰 News & Insights
.news() - Recent news articles
.technical_insights - Bullish/bearish technical patterns
💰 Funds & ETFs Only
.fund_holding_info - Top holdings, bond/equity breakdown
.fund_performance - Historical performance and returns
.fund_bond_holdings / .fund_bond_ratings - Bond maturity and credit ratings
.fund_equity_holdings - P/E, P/B, P/S for equity holdings
📊 Other Modules
.summary_detail - Trading stats (day high/low, volume, avg volume)
.default_key_statistics - Enterprise value, trailing P/E, forward P/E
.index_trend - Performance relative to a benchmark index
.quote_type - Security type, exchange, market
Global Functions
import yahooquery as yq
# Search
results = yq.search('NVIDIA')
# Market Data
market = yq.get_market_summary(country='US') # Major indices snapshot
trending = yq.get_trending(country='US') # Trending tickers
# Utilities
currencies = yq.get_currencies() # List of supported currencies
exchanges = yq.get_exchanges() # List of exchanges
rate = yq.currency_converter('USD', 'EUR') # Exchange rate
Configuration & Keyword Arguments
The Ticker, Screener, and Research classes accept these optional parameters:
Performance & Reliability
asynchronous=True - Make requests asynchronously (for multiple symbols)
max_workers=8 - Number of concurrent workers (when async)
retry=5 - Number of retry attempts
backoff_factor=0.3 - Exponential backoff between retries
status_forcelist=[429, 500, 502, 503, 504] - HTTP codes to retry
timeout=5 - Request timeout in seconds
Data Format & Validation
formatted=False - If True, returns data with {raw, fmt, longFmt} structure
validate=True - Validate symbols on instantiation (invalid → .invalid_symbols)
country='United States' - Regional data/news (france, germany, canada, etc.)
Network & Auth
proxies={'http': 'http://proxy:port'} - HTTP/HTTPS proxy
user_agent='...' - Custom user agent string
verify=True - SSL certificate verification
username='you@email.com' / password='...' - Yahoo Finance Premium login
Advanced (Shared Sessions)
session=... / crumb=... - Share auth between Research and Ticker instances
Best Practices
1. Async for Multiple Symbols
tickers = Ticker('AAPL MSFT NVDA TSLA', asynchronous=True)
prices = tickers.price # Returns dict keyed by symbol
2. Handling DataFrames
Most financial methods return pandas.DataFrame. Convert for JSON output:
df = aapl.income_statement()
print(df.to_json(orient='records', date_format='iso'))
3. Historical Data - 1-Minute Intervals
Yahoo limits 1-minute data to 7 days per request. For 30 days:
tickers = Ticker('AAPL', asynchronous=True)
df = tickers.history(period='1mo', interval='1m') # Makes 4 requests automatically
4. Premium Users: Combining Research + Ticker
r = Research(username='...', password='...')
reports = r.reports(sector='Technology', investment_rating='Bullish')
# Reuse session for Ticker
tickers = Ticker('AAPL', session=r.session, crumb=r.crumb)
data = tickers.asset_profile
Common Use Cases
Portfolio Analysis
portfolio = Ticker('AAPL MSFT NVDA', asynchronous=True)
summary = portfolio.summary_detail
earnings = portfolio.earnings
history = portfolio.history(period='1y')
Screening & Discovery
s = Screener()
gainers = s.get_screeners(['day_gainers'], count=20)
# Returns DataFrame with price, volume, % change, etc.
Options Analysis
nvda = Ticker('NVDA')
options = nvda.option_chain
# Filter for calls/puts, strikes, expirations
Earnings Calendar
tickers = Ticker('AAPL MSFT NVDA')
calendar = tickers.calendar_events
# Shows next earnings date + analyst estimates
Reference Documentation
Full API docs at: /Users/henryzha/.openclaw/workspace-research/skills/yahooquery/references/
index.md - Overview of classes and functions
ticker/ - Detailed breakdown of all Ticker methods
screener.md - Screener class guide
research.md - Research class (Premium)
keyword_arguments.md - Complete list of configuration options
misc.md - Global utility functions
advanced.md - Sharing sessions between Research and Ticker
Environment
- Installation:
python3 -m pip install yahooquery
- Dependencies: pandas, requests-futures, tqdm, beautifulsoup4, lxml
- Python Version: 3.7+
Notes
- Yahoo Finance may rate-limit or block requests. Use
retry, backoff_factor, and status_forcelist for robustness.
- Premium features (Research class) require a paid Yahoo Finance Premium subscription.
- Data accuracy and availability depend on Yahoo Finance's upstream data providers.
1---2name: access-yahoo-finance-data3description: "Access Yahoo Finance data including real-time pricing, fundamentals, analyst estimates, options, news, and historical data via the yahooquery Python library."4category: "Finance & Crypto"5author: community6version: "1.0.0"7icon: coins8metadata:9 source: https://skillmd.com/skills/rondoflow/access-yahoo-finance-data10---1112# yahooquery Skill1314Comprehensive access to Yahoo Finance data via the `yahooquery` Python library. This library provides programmatic access to nearly all Yahoo Finance endpoints, including real-time pricing, fundamentals, analyst estimates, options, news, and premium research.1516## Core Classes1718### 1. **Ticker** (Company-Specific Data)19The primary interface for retrieving data about one or more securities.2021```python22from yahooquery import Ticker2324# Single or multiple symbols25aapl = Ticker('AAPL')26tickers = Ticker('AAPL MSFT NVDA', asynchronous=True)27```2829### 2. **Screener** (Predefined Stock Lists)30Access to pre-built screeners for discovering stocks by criteria.3132```python33from yahooquery import Screener3435s = Screener()36screeners = s.available_screeners # List all available screeners37data = s.get_screeners(['day_gainers', 'most_actives'], count=10)38```3940### 3. **Research** (Premium Subscription Required)41Access proprietary research reports and trade ideas.4243```python44from yahooquery import Research4546r = Research(username='you@email.com', password='password')47reports = r.reports(report_type='Analyst Report', report_date='Last Week')48trades = r.trades(trend='Bullish', term='Short term')49```5051---5253## Ticker Class: Data Modules5455The `Ticker` class exposes dozens of data endpoints via properties and methods.5657### 📊 **Financial Statements**58- `.income_statement(frequency='a', trailing=True)` - Income statement (annual/quarterly)59- `.balance_sheet(frequency='a', trailing=True)` - Balance sheet60- `.cash_flow(frequency='a', trailing=True)` - Cash flow statement61- `.all_financial_data(frequency='a')` - Combined financials + valuation measures62- `.valuation_measures` - EV/EBITDA, P/E, P/B, P/S across periods6364### 📈 **Pricing & Market Data**65- `.price` - Current pricing, market cap, 52-week range66- `.history(period='1y', interval='1d', start=None, end=None)` - Historical OHLC67 - **period**: `1d`, `5d`, `1mo`, `3mo`, `6mo`, `1y`, `2y`, `5y`, `10y`, `ytd`, `max`68 - **interval**: `1m`, `2m`, `5m`, `15m`, `30m`, `60m`, `90m`, `1h`, `1d`, `5d`, `1wk`, `1mo`, `3mo`69- `.option_chain` - Full options chain (all expirations)7071### 🔍 **Analysis & Estimates**72- `.calendar_events` - Next earnings date, EPS/revenue estimates73- `.earning_history` - Actual vs. estimated EPS (last 4 quarters)74- `.earnings` - Historical quarterly/annual earnings and revenue75- `.earnings_trend` - Analyst estimates for upcoming periods76- `.recommendation_trend` - Buy/Sell/Hold rating changes over time77- `.gradings` - Recent analyst upgrades/downgrades7879### 🏢 **Company Fundamentals**80- `.asset_profile` - Address, industry, sector, business summary, officers81- `.company_officers` - Executives with compensation details82- `.summary_profile` - Condensed company information83- `.key_stats` - Forward P/E, profit margin, beta, shares outstanding84- `.financial_data` - Financial KPIs (ROE, ROA, debt-to-equity, margins)8586### 👥 **Ownership & Governance**87- `.insider_holders` - List of insider holders and positions88- `.insider_transactions` - Recent buy/sell transactions by insiders89- `.institution_ownership` - Top institutional holders90- `.fund_ownership` - Top mutual fund holders91- `.major_holders` - Ownership summary (institutional %, insider %, float)9293### 🌍 **ESG & Ratings**94- `.esg_scores` - Environmental, Social, Governance scores and controversies95- `.recommendation_rating` - Analyst consensus (Strong Buy → Strong Sell)9697### 📰 **News & Insights**98- `.news()` - Recent news articles99- `.technical_insights` - Bullish/bearish technical patterns100101### 💰 **Funds & ETFs Only**102- `.fund_holding_info` - Top holdings, bond/equity breakdown103- `.fund_performance` - Historical performance and returns104- `.fund_bond_holdings` / `.fund_bond_ratings` - Bond maturity and credit ratings105- `.fund_equity_holdings` - P/E, P/B, P/S for equity holdings106107### 📊 **Other Modules**108- `.summary_detail` - Trading stats (day high/low, volume, avg volume)109- `.default_key_statistics` - Enterprise value, trailing P/E, forward P/E110- `.index_trend` - Performance relative to a benchmark index111- `.quote_type` - Security type, exchange, market112113---114115## Global Functions116117```python118import yahooquery as yq119120# Search121results = yq.search('NVIDIA')122123# Market Data124market = yq.get_market_summary(country='US') # Major indices snapshot125trending = yq.get_trending(country='US') # Trending tickers126127# Utilities128currencies = yq.get_currencies() # List of supported currencies129exchanges = yq.get_exchanges() # List of exchanges130rate = yq.currency_converter('USD', 'EUR') # Exchange rate131```132133---134135## Configuration & Keyword Arguments136137The `Ticker`, `Screener`, and `Research` classes accept these optional parameters:138139### Performance & Reliability140- `asynchronous=True` - Make requests asynchronously (for multiple symbols)141- `max_workers=8` - Number of concurrent workers (when async)142- `retry=5` - Number of retry attempts143- `backoff_factor=0.3` - Exponential backoff between retries144- `status_forcelist=[429, 500, 502, 503, 504]` - HTTP codes to retry145- `timeout=5` - Request timeout in seconds146147### Data Format & Validation148- `formatted=False` - If `True`, returns data with `{raw, fmt, longFmt}` structure149- `validate=True` - Validate symbols on instantiation (invalid → `.invalid_symbols`)150- `country='United States'` - Regional data/news (france, germany, canada, etc.)151152### Network & Auth153- `proxies={'http': 'http://proxy:port'}` - HTTP/HTTPS proxy154- `user_agent='...'` - Custom user agent string155- `verify=True` - SSL certificate verification156- `username='you@email.com'` / `password='...'` - Yahoo Finance Premium login157158### Advanced (Shared Sessions)159- `session=...` / `crumb=...` - Share auth between `Research` and `Ticker` instances160161---162163## Best Practices164165### 1. **Async for Multiple Symbols**166```python167tickers = Ticker('AAPL MSFT NVDA TSLA', asynchronous=True)168prices = tickers.price # Returns dict keyed by symbol169```170171### 2. **Handling DataFrames**172Most financial methods return `pandas.DataFrame`. Convert for JSON output:173```python174df = aapl.income_statement()175print(df.to_json(orient='records', date_format='iso'))176```177178### 3. **Historical Data - 1-Minute Intervals**179Yahoo limits 1-minute data to 7 days per request. For 30 days:180```python181tickers = Ticker('AAPL', asynchronous=True)182df = tickers.history(period='1mo', interval='1m') # Makes 4 requests automatically183```184185### 4. **Premium Users: Combining Research + Ticker**186```python187r = Research(username='...', password='...')188reports = r.reports(sector='Technology', investment_rating='Bullish')189190# Reuse session for Ticker191tickers = Ticker('AAPL', session=r.session, crumb=r.crumb)192data = tickers.asset_profile193```194195---196197## Common Use Cases198199### Portfolio Analysis200```python201portfolio = Ticker('AAPL MSFT NVDA', asynchronous=True)202summary = portfolio.summary_detail203earnings = portfolio.earnings204history = portfolio.history(period='1y')205```206207### Screening & Discovery208```python209s = Screener()210gainers = s.get_screeners(['day_gainers'], count=20)211# Returns DataFrame with price, volume, % change, etc.212```213214### Options Analysis215```python216nvda = Ticker('NVDA')217options = nvda.option_chain218# Filter for calls/puts, strikes, expirations219```220221### Earnings Calendar222```python223tickers = Ticker('AAPL MSFT NVDA')224calendar = tickers.calendar_events225# Shows next earnings date + analyst estimates226```227228---229230## Reference Documentation231232Full API docs at: `/Users/henryzha/.openclaw/workspace-research/skills/yahooquery/references/`233234- `index.md` - Overview of classes and functions235- `ticker/` - Detailed breakdown of all Ticker methods236- `screener.md` - Screener class guide237- `research.md` - Research class (Premium)238- `keyword_arguments.md` - Complete list of configuration options239- `misc.md` - Global utility functions240- `advanced.md` - Sharing sessions between Research and Ticker241242---243244## Environment245246- **Installation**: `python3 -m pip install yahooquery`247- **Dependencies**: pandas, requests-futures, tqdm, beautifulsoup4, lxml248- **Python Version**: 3.7+249250---251252## Notes253254- Yahoo Finance may rate-limit or block requests. Use `retry`, `backoff_factor`, and `status_forcelist` for robustness.255- Premium features (Research class) require a paid Yahoo Finance Premium subscription.256- Data accuracy and availability depend on Yahoo Finance's upstream data providers.