Build a pre-earnings briefing for a stock from Yahoo Finance data (yfinance): the upcoming report date and timing, consensus EPS and revenue estimates with their range, the beat/miss track record, analyst ratings and price targets, and what to watch in the print. Use this skill whenever the user is preparing for an upcoming earnings report or asks what the street expects — consensus or whisper numbers, EPS expectations, whether a company will beat, an earnings setup, or an earnings-season preview — and whenever a ticker comes up in the context of upcoming earnings, even without the word "preview". For results that are already out, use earnings-recap.
72
87%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Generates a pre-earnings briefing using Yahoo Finance data via yfinance. Pulls together upcoming earnings date, consensus estimates, historical accuracy, analyst sentiment, and key financial context — everything you need before an earnings call.
Important: Data is for research and educational purposes only. Not financial advice. yfinance is not affiliated with Yahoo, Inc.
Current environment status:
!`python3 -c "exec('try:\n import yfinance\n print(\'yfinance \' + yfinance.__version__ + \' installed\')\nexcept Exception:\n print(\'YFINANCE_NOT_INSTALLED\')')"`If YFINANCE_NOT_INSTALLED, install it:
import subprocess, sys
subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "yfinance"])If already installed, skip to the next step.
Extract the ticker symbol from the user's request. If they mention a company name without a ticker, look it up. Then fetch all relevant data in one script to minimize API calls.
import yfinance as yf
ticker = yf.Ticker("AAPL") # replace with actual ticker
# --- Core data ---
info = ticker.info
calendar = ticker.calendar
earnings_dates = ticker.get_earnings_dates(limit=8) # report timestamps; the upcoming one has no Reported EPS yet
hist = ticker.history(period="1mo") # recent price performance
# --- Estimates ---
earnings_est = ticker.earnings_estimate
revenue_est = ticker.revenue_estimate
# --- Historical track record ---
earnings_hist = ticker.earnings_history
# --- Analyst sentiment ---
price_targets = ticker.analyst_price_targets
recommendations = ticker.recommendations
# --- Recent financials for context ---
quarterly_income = ticker.quarterly_income_stmt
quarterly_cashflow = ticker.quarterly_cashflow| Data Source | Key Fields | Purpose |
|---|---|---|
calendar | Earnings Date, Ex-Dividend Date | When earnings are and key dates |
get_earnings_dates() | Earnings Date (tz-aware timestamp), EPS Estimate, Reported EPS | Report timing: the upcoming row has no Reported EPS; a time at or after 16:00 ET means after the close, earlier times mean before the open |
earnings_estimate | avg, low, high, numberOfAnalysts, yearAgoEps, growth (for 0q, +1q, 0y, +1y) | Consensus EPS expectations |
revenue_estimate | avg, low, high, numberOfAnalysts, yearAgoRevenue, growth | Revenue expectations |
earnings_history | epsEstimate, epsActual, epsDifference, surprisePercent | Beat/miss track record (indexed by fiscal quarter-end, oldest first) |
analyst_price_targets | current, low, high, mean, median | Street price targets |
recommendations | Buy/Hold/Sell counts | Sentiment distribution |
quarterly_income_stmt | TotalRevenue, NetIncome, BasicEPS | Recent trajectory |
The briefing should let the user see the setup at a glance. Cover these five areas; if the data for one is missing, say so in a line rather than dropping it.
Open with the headline — the report date and a one-line read of the setup — then the five areas above, using tables where they help. Close with a short read of the overall setup drawn from the estimates, track record, and sentiment, framed as what the street expects rather than a recommendation.
Include the caveats that apply: estimates can change until the report date, past beats don't guarantee future ones, Yahoo Finance consensus can lag real-time providers by a few hours, and this is not financial advice.
references/api_reference.md — Detailed yfinance API reference for earnings and estimate methodsRead the reference file when you need exact method signatures or edge case handling.
7fe9185
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.