From 911765d8d1094df1baed4c3a313988e18cc31755 Mon Sep 17 00:00:00 2001 From: Tyler Hoang Date: Mon, 22 Jun 2026 15:11:45 -0700 Subject: feat: add backend news service with Finnhub/FMP fallback and sentiment --- backend/app/main.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'backend/app/main.py') diff --git a/backend/app/main.py b/backend/app/main.py index 71ddd7a..e7b9691 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -9,8 +9,8 @@ from fastapi import FastAPI, HTTPException, Query, status from fastapi.middleware.cors import CORSMiddleware from app.db import watchlist -from app.schemas import FilingsResponse, FinancialsResponse, HistoryPoint, InsidersResponse, MarketIndex, RatiosResponse, SearchResult, TickerOverview, ValuationResponse, WatchlistResponse -from app.services import data_service +from app.schemas import FilingsResponse, FinancialsResponse, HistoryPoint, InsidersResponse, MarketIndex, NewsResponse, RatiosResponse, SearchResult, TickerOverview, ValuationResponse, WatchlistResponse +from app.services import data_service, news_service load_dotenv() @@ -90,6 +90,11 @@ def ticker_filings(symbol: str) -> dict: return data_service.get_sec_filings(symbol) +@app.get("/api/tickers/{symbol}/news", response_model=NewsResponse) +def ticker_news(symbol: str) -> dict: + return news_service.get_news(symbol) + + @app.get("/api/watchlist", response_model=WatchlistResponse) def get_watchlist() -> dict: items = [] -- cgit v1.3-2-g0d8e