summaryrefslogtreecommitdiff
path: root/backend/app/main.py
diff options
context:
space:
mode:
authorTyler Hoang <tyler@tylerhoang.xyz>2026-06-22 15:11:45 -0700
committerTyler Hoang <tyler@tylerhoang.xyz>2026-06-22 15:11:45 -0700
commit911765d8d1094df1baed4c3a313988e18cc31755 (patch)
treee209289341237a9769e84158df36cc16937bdcae /backend/app/main.py
parent570b2ec7c5890ef6f11eab5ac1c56eb3ec90911f (diff)
feat: add backend news service with Finnhub/FMP fallback and sentiment
Diffstat (limited to 'backend/app/main.py')
-rw-r--r--backend/app/main.py9
1 files changed, 7 insertions, 2 deletions
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 = []