summaryrefslogtreecommitdiff
path: root/backend/app
diff options
context:
space:
mode:
authorTyler Hoang <tyler@tylerhoang.xyz>2026-05-18 02:37:26 -0700
committerTyler Hoang <tyler@tylerhoang.xyz>2026-05-18 02:37:26 -0700
commit37ac7be64d18bf1957e5400597abfb9d2d73c0c5 (patch)
tree143126eb6993a031c95d7a41ce034f484aeb7abc /backend/app
parent38bef98ab1964bc9365d17c4a5ca17cdbd32673b (diff)
feat: add GET /api/tickers/{symbol}/ratios route
Diffstat (limited to 'backend/app')
-rw-r--r--backend/app/main.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/backend/app/main.py b/backend/app/main.py
index 1cc127e..7e02cbe 100644
--- a/backend/app/main.py
+++ b/backend/app/main.py
@@ -9,7 +9,7 @@ from fastapi import FastAPI, HTTPException, Query, status
from fastapi.middleware.cors import CORSMiddleware
from app.db import watchlist
-from app.schemas import FinancialsResponse, HistoryPoint, MarketIndex, SearchResult, TickerOverview, ValuationResponse, WatchlistResponse
+from app.schemas import FinancialsResponse, HistoryPoint, MarketIndex, RatiosResponse, SearchResult, TickerOverview, ValuationResponse, WatchlistResponse
from app.services import data_service
load_dotenv()
@@ -75,6 +75,11 @@ def ticker_valuation(symbol: str) -> dict:
return data_service.get_valuation(symbol)
+@app.get("/api/tickers/{symbol}/ratios", response_model=RatiosResponse)
+def ticker_ratios(symbol: str) -> dict:
+ return data_service.get_ratios(symbol)
+
+
@app.get("/api/watchlist", response_model=WatchlistResponse)
def get_watchlist() -> dict:
items = []