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: yahooquery
3description: Access Yahoo Finance data including real-time pricing, fundamentals, analyst estimates, options, news, and historical data via the yahooquery Python library.
4metadata:
5 source: https://skillmd.com/skills/modbender/yahooquery
6---
7
8# yahooquery Skill
9
10Comprehensive 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.
11
12## Core Classes
13
14### 1. **Ticker** (Company-Specific Data)
15The primary interface for retrieving data about one or more securities.
16
17```python
18from yahooquery import Ticker
19
20# Single or multiple symbols
21aapl = Ticker('AAPL')
22tickers = Ticker('AAPL MSFT NVDA', asynchronous=True)
23```
24
25### 2. **Screener** (Predefined Stock Lists)
26Access to pre-built screeners for discovering stocks by criteria.
27
28```python
29from yahooquery import Screener
30
31s = Screener()
32screeners = s.available_screeners # List all available screeners
33data = s.get_screeners(['day_gainers', 'most_actives'], count=10)
34```
35
36### 3. **Research** (Premium Subscription Required)
37Access proprietary research reports and trade ideas.
38
39```python
40from yahooquery import Research
41
42r = Research(username='you@email.com', password='password')
43reports = r.reports(report_type='Analyst Report', report_date='Last Week')
44trades = r.trades(trend='Bullish', term='Short term')
45```
46
47---
48
49## Ticker Class: Data Modules
50
51The `Ticker` class exposes dozens of data endpoints via properties and methods.
52
53### 📊 **Financial Statements**
54- `.income_statement(frequency='a', trailing=True)` - Income statement (annual/quarterly)
55- `.balance_sheet(frequency='a', trailing=True)` - Balance sheet
56- `.cash_flow(frequency='a', trailing=True)` - Cash flow statement
57- `.all_financial_data(frequency='a')` - Combined financials + valuation measures
58- `.valuation_measures` - EV/EBITDA, P/E, P/B, P/S across periods
59
60### 📈 **Pricing & Market Data**
61- `.price` - Current pricing, market cap, 52-week range
62- `.history(period='1y', interval='1d', start=None, end=None)` - Historical OHLC
63 - **period**: `1d`, `5d`, `1mo`, `3mo`, `6mo`, `1y`, `2y`, `5y`, `10y`, `ytd`, `max`
64 - **interval**: `1m`, `2m`, `5m`, `15m`, `30m`, `60m`, `90m`, `1h`, `1d`, `5d`, `1wk`, `1mo`, `3mo`
65- `.option_chain` - Full options chain (all expirations)
66
67### 🔍 **Analysis & Estimates**
68- `.calendar_events` - Next earnings date, EPS/revenue estimates
69- `.earning_history` - Actual vs. estimated EPS (last 4 quarters)
70- `.earnings` - Historical quarterly/annual earnings and revenue
71- `.earnings_trend` - Analyst estimates for upcoming periods
72- `.recommendation_trend` - Buy/Sell/Hold rating changes over time
73- `.gradings` - Recent analyst upgrades/downgrades
74
75### 🏢 **Company Fundamentals**
76- `.asset_profile` - Address, industry, sector, business summary, officers
77- `.company_officers` - Executives with compensation details
78- `.summary_profile` - Condensed company information
79- `.key_stats` - Forward P/E, profit margin, beta, shares outstanding
80- `.financial_data` - Financial KPIs (ROE, ROA, debt-to-equity, margins)
81
82### 👥 **Ownership & Governance**
83- `.insider_holders` - List of insider holders and positions
84- `.insider_transactions` - Recent buy/sell transactions by insiders
85- `.institution_ownership` - Top institutional holders
86- `.fund_ownership` - Top mutual fund holders
87- `.major_holders` - Ownership summary (institutional %, insider %, float)
88
89### 🌍 **ESG & Ratings**
90- `.esg_scores` - Environmental, Social, Governance scores and controversies
91- `.recommendation_rating` - Analyst consensus (Strong Buy → Strong Sell)
92
93### 📰 **News & Insights**
94- `.news()` - Recent news articles
95- `.technical_insights` - Bullish/bearish technical patterns
96
97### 💰 **Funds & ETFs Only**
98- `.fund_holding_info` - Top holdings, bond/equity breakdown
99- `.fund_performance` - Historical performance and returns
100- `.fund_bond_holdings` / `.fund_bond_ratings` - Bond maturity and credit ratings
101- `.fund_equity_holdings` - P/E, P/B, P/S for equity holdings
102
103### 📊 **Other Modules**
104- `.summary_detail` - Trading stats (day high/low, volume, avg volume)
105- `.default_key_statistics` - Enterprise value, trailing P/E, forward P/E
106- `.index_trend` - Performance relative to a benchmark index
107- `.quote_type` - Security type, exchange, market
108
109---
110
111## Global Functions
112
113```python
114import yahooquery as yq
115
116# Search
117results = yq.search('NVIDIA')
118
119# Market Data
120market = yq.get_market_summary(country='US') # Major indices snapshot
121trending = yq.get_trending(country='US') # Trending tickers
122
123# Utilities
124currencies = yq.get_currencies() # List of supported currencies
125exchanges = yq.get_exchanges() # List of exchanges
126rate = yq.currency_converter('USD', 'EUR') # Exchange rate
127```
128
129---
130
131## Configuration & Keyword Arguments
132
133The `Ticker`, `Screener`, and `Research` classes accept these optional parameters:
134
135### Performance & Reliability
136- `asynchronous=True` - Make requests asynchronously (for multiple symbols)
137- `max_workers=8` - Number of concurrent workers (when async)
138- `retry=5` - Number of retry attempts
139- `backoff_factor=0.3` - Exponential backoff between retries
140- `status_forcelist=[429, 500, 502, 503, 504]` - HTTP codes to retry
141- `timeout=5` - Request timeout in seconds
142
143### Data Format & Validation
144- `formatted=False` - If `True`, returns data with `{raw, fmt, longFmt}` structure
145- `validate=True` - Validate symbols on instantiation (invalid → `.invalid_symbols`)
146- `country='United States'` - Regional data/news (france, germany, canada, etc.)
147
148### Network & Auth
149- `proxies={'http': 'http://proxy:port'}` - HTTP/HTTPS proxy
150- `user_agent='...'` - Custom user agent string
151- `verify=True` - SSL certificate verification
152- `username='you@email.com'` / `password='...'` - Yahoo Finance Premium login
153
154### Advanced (Shared Sessions)
155- `session=...` / `crumb=...` - Share auth between `Research` and `Ticker` instances
156
157---
158
159## Best Practices
160
161### 1. **Async for Multiple Symbols**
162```python
163tickers = Ticker('AAPL MSFT NVDA TSLA', asynchronous=True)
164prices = tickers.price # Returns dict keyed by symbol
165```
166
167### 2. **Handling DataFrames**
168Most financial methods return `pandas.DataFrame`. Convert for JSON output:
169```python
170df = aapl.income_statement()
171print(df.to_json(orient='records', date_format='iso'))
172```
173
174### 3. **Historical Data - 1-Minute Intervals**
175Yahoo limits 1-minute data to 7 days per request. For 30 days:
176```python
177tickers = Ticker('AAPL', asynchronous=True)
178df = tickers.history(period='1mo', interval='1m') # Makes 4 requests automatically
179```
180
181### 4. **Premium Users: Combining Research + Ticker**
182```python
183r = Research(username='...', password='...')
184reports = r.reports(sector='Technology', investment_rating='Bullish')
185
186# Reuse session for Ticker
187tickers = Ticker('AAPL', session=r.session, crumb=r.crumb)
188data = tickers.asset_profile
189```
190
191---
192
193## Common Use Cases
194
195### Portfolio Analysis
196```python
197portfolio = Ticker('AAPL MSFT NVDA', asynchronous=True)
198summary = portfolio.summary_detail
199earnings = portfolio.earnings
200history = portfolio.history(period='1y')
201```
202
203### Screening & Discovery
204```python
205s = Screener()
206gainers = s.get_screeners(['day_gainers'], count=20)
207# Returns DataFrame with price, volume, % change, etc.
208```
209
210### Options Analysis
211```python
212nvda = Ticker('NVDA')
213options = nvda.option_chain
214# Filter for calls/puts, strikes, expirations
215```
216
217### Earnings Calendar
218```python
219tickers = Ticker('AAPL MSFT NVDA')
220calendar = tickers.calendar_events
221# Shows next earnings date + analyst estimates
222```
223
224---
225
226## Reference Documentation
227
228Full API docs at: `/Users/henryzha/.openclaw/workspace-research/skills/yahooquery/references/`
229
230- `index.md` - Overview of classes and functions
231- `ticker/` - Detailed breakdown of all Ticker methods
232- `screener.md` - Screener class guide
233- `research.md` - Research class (Premium)
234- `keyword_arguments.md` - Complete list of configuration options
235- `misc.md` - Global utility functions
236- `advanced.md` - Sharing sessions between Research and Ticker
237
238---
239
240## Environment
241
242- **Installation**: `python3 -m pip install yahooquery`
243- **Dependencies**: pandas, requests-futures, tqdm, beautifulsoup4, lxml
244- **Python Version**: 3.7+
245
246---
247
248## Notes
249
250- Yahoo Finance may rate-limit or block requests. Use `retry`, `backoff_factor`, and `status_forcelist` for robustness.
251- Premium features (Research class) require a paid Yahoo Finance Premium subscription.
252- Data accuracy and availability depend on Yahoo Finance's upstream data providers.