diff options
| author | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-18 01:32:48 -0700 |
|---|---|---|
| committer | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-18 01:32:48 -0700 |
| commit | 0662a31869ad60dbb76b2f534fe294d15b3b3492 (patch) | |
| tree | 6328b0bc7275e403fd39808b7af4824fca857ee5 /backend/app/main.py | |
| parent | b877047a76cd4b661dccfd1dc8c0e7f2aa6a346c (diff) | |
feat: add GET /api/tickers/{symbol}/valuation route
Diffstat (limited to 'backend/app/main.py')
| -rw-r--r-- | backend/app/main.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/backend/app/main.py b/backend/app/main.py index eb5fa40..1cc127e 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, WatchlistResponse +from app.schemas import FinancialsResponse, HistoryPoint, MarketIndex, SearchResult, TickerOverview, ValuationResponse, WatchlistResponse from app.services import data_service load_dotenv() @@ -70,6 +70,11 @@ def ticker_financials(symbol: str, period: str = Query(default="annual", pattern return data_service.get_financials(symbol, period=period) +@app.get("/api/tickers/{symbol}/valuation", response_model=ValuationResponse) +def ticker_valuation(symbol: str) -> dict: + return data_service.get_valuation(symbol) + + @app.get("/api/watchlist", response_model=WatchlistResponse) def get_watchlist() -> dict: items = [] |
