Replace Yahoo Finance with Polygon.io for chart data

- Add Polygon.io API client for reliable historical data access
- Update bot to use Polygon instead of Yahoo Finance for charts
- Add POLYGON_API_KEY to config and environment example
- Polygon free tier: 5 API calls/minute, more reliable than Yahoo
- Fallback to FinViz chart URL when Polygon unavailable

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Michael Simard
2025-12-26 11:48:42 -06:00
parent 6bbf389a60
commit 639abc71f6
5 changed files with 216 additions and 23 deletions

View File

@@ -19,6 +19,7 @@ class Config:
PRIMARY_TICKER = os.getenv('PRIMARY_TICKER', 'PYPL')
STOCK_API_PROVIDER = os.getenv('STOCK_API_PROVIDER', 'finnhub') # 'yahoo' or 'finnhub'
FINNHUB_API_KEY = os.getenv('FINNHUB_API_KEY')
POLYGON_API_KEY = os.getenv('POLYGON_API_KEY')
# Earnings calendar configuration
EARNINGS_MIN_MARKET_CAP_BILLIONS = float(os.getenv('EARNINGS_MIN_MARKET_CAP_BILLIONS', '10'))