Earnings Recap Skill
Generates a post-earnings analysis using Yahoo Finance data via yfinance. Covers the actual vs estimated numbers, surprise magnitude, stock price reaction, and financial context — a complete picture of what happened.
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 Data
Extract the ticker from the user's request. Fetch all relevant post-earnings data in one script.
What to extract
Step 3: Find the Report and Measure the Reaction
earnings_history is indexed by fiscal quarter-end, not by announcement date, so take report timing from get_earnings_dates(): the most recent report is the newest row with a Reported EPS. Its timestamp (US Eastern) sets the reaction window: at or after 16:00 means the company reported after the close; anything earlier means before the open or, occasionally, during the session. If the user asked about a specific quarter, use that row instead.
If reaction_pct is None, the report came after the most recent close; say the regular-session reaction is still pending (an intraday history(..., prepost=True) call shows the after-hours move if the user wants it).
Step 4: Build the Earnings Recap
Cover these areas, leading with the result:
- Headline result — EPS actual vs estimate with the surprise %, revenue with year-over-year growth, and the stock's reaction.
- Estimates vs actuals — EPS estimate, actual, and surprise ($ and %) for the quarter in question.
- Quarterly trends — revenue, gross margin, operating margin, and EPS for the recent quarters, with margins computed from the statements (gross profit / revenue, operating income / revenue). yfinance usually returns about five quarters, so year-over-year growth is available for the latest quarter only (column 0 vs column 4); show sequential change for the others rather than inventing a comparison.
- Price reaction — the move in the reaction session, how it compares with the stock's average absolute earnings move over the prior four reports, and whether the stock has since held, given back, or extended the move.
- What changed — margin direction vs the prior quarter, any shift in the revenue growth trajectory, how this surprise compares with the company's usual pattern, and current analyst sentiment if available.
Step 5: Respond to the User
Open with the headline — which quarter, when it was reported, the beat or miss, revenue growth, and the reaction — then the supporting tables. Say what matters: whether this was a meaningful beat or a low bar cleared, and whether the trend is improving or deteriorating. Keep it factual and leave out investment recommendations.
Include the caveats that apply: Yahoo Finance data doesn't capture everything from the call (guidance, segment detail), revenue is compared year over year from the statements rather than against a revenue consensus, the price reaction can reflect a broader market move that day, and this is not financial advice.
Reference Files
references/api_reference.md— Detailed yfinance API reference for earnings history and financial statement methods
Read the reference file when you need exact method signatures or to handle edge cases in the financial data.

