diff options
| author | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-06-29 01:37:17 -0700 |
|---|---|---|
| committer | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-06-29 01:37:17 -0700 |
| commit | 74fcf05bf9a8d2bccb0016896ffa49886bc81300 (patch) | |
| tree | 2a059a16e498712a83d2d6875a0758a824e8eca8 /backend | |
| parent | 7ff551560c092ff5b108f7a84517f412c969358d (diff) | |
feat: add valuation and DCF API endpoints
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/app/main.py | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/backend/app/main.py b/backend/app/main.py index e7b9691..b4b7e1b 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -9,7 +9,21 @@ 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, NewsResponse, RatiosResponse, SearchResult, TickerOverview, ValuationResponse, WatchlistResponse +from app.schemas import ( + AdvancedDcfInputs, + FilingsResponse, + FinancialsResponse, + HistoryPoint, + InsidersResponse, + MarketIndex, + NewsResponse, + RatiosResponse, + SearchResult, + TickerOverview, + ValuationResponse, + WaccResponse, + WatchlistResponse, +) from app.services import data_service, news_service load_dotenv() @@ -75,6 +89,16 @@ def ticker_valuation(symbol: str) -> dict: return data_service.get_valuation(symbol) +@app.post("/api/tickers/{symbol}/valuation/advanced", response_model=ValuationResponse) +def ticker_advanced_valuation(symbol: str, inputs: AdvancedDcfInputs) -> dict: + return data_service.get_advanced_valuation(symbol, inputs) + + +@app.get("/api/tickers/{symbol}/wacc", response_model=WaccResponse) +def ticker_wacc(symbol: str) -> dict[str, str | bool | float | None]: + return data_service.compute_wacc(symbol) + + @app.get("/api/tickers/{symbol}/ratios", response_model=RatiosResponse) def ticker_ratios(symbol: str) -> dict: return data_service.get_ratios(symbol) |
