News Sentiment
Fetch recent news from Yahoo Finance: yfinance's ticker news first, then Yahoo's per-ticker RSS feed when that comes back empty or fails.
Instructions
Note: If
uvis not installed orpyproject.tomlis not found, replaceuv run pythonwithpythonin all commands below.
uv run python scripts/news.py SYMBOL [--limit LIMIT]Arguments
SYMBOL- Ticker symbol--limit- Number of articles (default: 10)
Output
Returns JSON with:
articles- Array of recent news with title, publisher, date (YYYY-MM-DD HH:MM ET), link, typecount- Number of articles returnedsource-"yfinance"or"yahoo-rss"note- Withyahoo-rss: items are tagged to the ticker, not necessarily about it, and arrive newest first.publisheris the link's host (oftenfinance.yahoo.com), since the feed carries no publishermessage: "No news found"- both sources answered with no articleserror- no articles and at least one source failed; never read this as "no news"
Present key headlines and note any significant news that could impact the stock. Judge the sentiment from the headlines yourself. With yahoo-rss, skip market-wide stories that are not about the company when assessing its sentiment.
Dependencies
yfinance
Timezone
All timestamps and time-based calculations must use the America/New_York timezone. All JSON output must include generated_at (NY time string) and data_delay fields.