File size: 401 Bytes
135f6a8
354ec89
135f6a8
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
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 []