Earnings Preview Skill
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.
Step 1: Ensure yfinance Is Available
Current environment status:
If YFINANCE_NOT_INSTALLED, install it:
If already installed, skip to the next step.
Step 2: Identify the Ticker and Gather All Data
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.
What to extract from each source
Step 3: Build the Earnings Preview
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.
- Date and context — company, ticker, sector and industry; the report date and whether it lands before the open or after the close; current price with 1-week and 1-month performance; market cap.
- Consensus estimates — a table of this quarter's EPS and revenue consensus with low, high, analyst count, year-ago value, and expected growth. A high/low spread wider than about 20% of consensus signals unusual uncertainty; say so when you see it.
- Beat/miss track record — the last four quarters of estimated vs actual EPS with surprise %, summarized as a beat count and average surprise.
- Analyst sentiment — the rating distribution (strong buy through strong sell) and the price-target range (low, mean, median, high), with the implied upside or downside from the mean target.
- What to watch — the few things the market will focus on in this print, chosen for this company and sector: revenue growth accelerating or decelerating, margins expanding or compressing, line items that moved sharply quarter over quarter, and segment trends where the data has them. This is the judgment part of the briefing.
Step 4: Respond to the User
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.
Reference Files
references/api_reference.md— Detailed yfinance API reference for earnings and estimate methods
Read the reference file when you need exact method signatures or edge case handling.

