Skills yahooquery
Access Yahoo Finance data including real-time pricing, fundamentals, analyst estimates, options, news, and historical data via the yahooquery Python library.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/512z/yahooquery" ~/.claude/skills/openclaw-skills-yahooquery && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/512z/yahooquery" ~/.openclaw/skills/openclaw-skills-yahooquery && rm -rf "$T"
manifest:
skills/512z/yahooquery/SKILL.mdsource content
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 (annual/quarterly).income_statement(frequency='a', trailing=True)
- Balance sheet.balance_sheet(frequency='a', trailing=True)
- Cash flow statement.cash_flow(frequency='a', trailing=True)
- Combined financials + valuation measures.all_financial_data(frequency='a')
- EV/EBITDA, P/E, P/B, P/S across periods.valuation_measures
📈 Pricing & Market Data
- Current pricing, market cap, 52-week range.price
- Historical OHLC.history(period='1y', interval='1d', start=None, end=None)- period:
,1d
,5d
,1mo
,3mo
,6mo
,1y
,2y
,5y
,10y
,ytdmax - interval:
,1m
,2m
,5m
,15m
,30m
,60m
,90m
,1h
,1d
,5d
,1wk
,1mo3mo
- period:
- Full options chain (all expirations).option_chain
🔍 Analysis & Estimates
- Next earnings date, EPS/revenue estimates.calendar_events
- Actual vs. estimated EPS (last 4 quarters).earning_history
- Historical quarterly/annual earnings and revenue.earnings
- Analyst estimates for upcoming periods.earnings_trend
- Buy/Sell/Hold rating changes over time.recommendation_trend
- Recent analyst upgrades/downgrades.gradings
🏢 Company Fundamentals
- Address, industry, sector, business summary, officers.asset_profile
- Executives with compensation details.company_officers
- Condensed company information.summary_profile
- Forward P/E, profit margin, beta, shares outstanding.key_stats
- Financial KPIs (ROE, ROA, debt-to-equity, margins).financial_data
👥 Ownership & Governance
- List of insider holders and positions.insider_holders
- Recent buy/sell transactions by insiders.insider_transactions
- Top institutional holders.institution_ownership
- Top mutual fund holders.fund_ownership
- Ownership summary (institutional %, insider %, float).major_holders
🌍 ESG & Ratings
- Environmental, Social, Governance scores and controversies.esg_scores
- Analyst consensus (Strong Buy → Strong Sell).recommendation_rating
📰 News & Insights
- Recent news articles.news()
- Bullish/bearish technical patterns.technical_insights
💰 Funds & ETFs Only
- Top holdings, bond/equity breakdown.fund_holding_info
- Historical performance and returns.fund_performance
/.fund_bond_holdings
- Bond maturity and credit ratings.fund_bond_ratings
- P/E, P/B, P/S for equity holdings.fund_equity_holdings
📊 Other Modules
- Trading stats (day high/low, volume, avg volume).summary_detail
- Enterprise value, trailing P/E, forward P/E.default_key_statistics
- Performance relative to a benchmark index.index_trend
- Security type, exchange, market.quote_type
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
- Make requests asynchronously (for multiple symbols)asynchronous=True
- Number of concurrent workers (when async)max_workers=8
- Number of retry attemptsretry=5
- Exponential backoff between retriesbackoff_factor=0.3
- HTTP codes to retrystatus_forcelist=[429, 500, 502, 503, 504]
- Request timeout in secondstimeout=5
Data Format & Validation
- Ifformatted=False
, returns data withTrue
structure{raw, fmt, longFmt}
- Validate symbols on instantiation (invalid →validate=True
).invalid_symbols
- Regional data/news (france, germany, canada, etc.)country='United States'
Network & Auth
- HTTP/HTTPS proxyproxies={'http': 'http://proxy:port'}
- Custom user agent stringuser_agent='...'
- SSL certificate verificationverify=True
/username='you@email.com'
- Yahoo Finance Premium loginpassword='...'
Advanced (Shared Sessions)
/session=...
- Share auth betweencrumb=...
andResearch
instancesTicker
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/
- Overview of classes and functionsindex.md
- Detailed breakdown of all Ticker methodsticker/
- Screener class guidescreener.md
- Research class (Premium)research.md
- Complete list of configuration optionskeyword_arguments.md
- Global utility functionsmisc.md
- Sharing sessions between Research and Tickeradvanced.md
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
, andbackoff_factor
for robustness.status_forcelist - Premium features (Research class) require a paid Yahoo Finance Premium subscription.
- Data accuracy and availability depend on Yahoo Finance's upstream data providers.