Spaces:
Runtime error
Runtime error
| import requests | |
| from config import Config | |
| class DataCollectionAgent: | |
| def __init__(self, config): | |
| self.config = config | |
| def collect_news(self, ticker): | |
| url = f"https://finnhub.io/api/v1/company-news?symbol={ticker}&from=2023-01-01&to=2025-12-31&token={self.config.FINNHUB_API_KEY}" | |
| resp = requests.get(url) | |
| return resp.json() if resp.status_code == 200 else [] | |