diff options
| author | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-18 00:46:27 -0700 |
|---|---|---|
| committer | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-18 00:46:27 -0700 |
| commit | 45f3eff514a7b4c2f03e801b204920f13671dd5d (patch) | |
| tree | a71e4cd06a4af8357003c9942760e019f52414dc /backend/app/main.py | |
| parent | 147664128fa0281333ba3150e007ed8e2f6a616a (diff) | |
| parent | 1e349b8904c6fa52c6f0925453513354c1a4e392 (diff) | |
Merge worktree-financials-tab: add financials tab (income/balance/cashflow)
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 fc98a5e..eb5fa40 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 HistoryPoint, MarketIndex, SearchResult, TickerOverview, WatchlistResponse +from app.schemas import FinancialsResponse, HistoryPoint, MarketIndex, SearchResult, TickerOverview, WatchlistResponse from app.services import data_service load_dotenv() @@ -65,6 +65,11 @@ def ticker_history(symbol: str, period: str = Query(default="1y", pattern="^(1m| return data_service.get_price_history(symbol, period=period) +@app.get("/api/tickers/{symbol}/financials", response_model=FinancialsResponse) +def ticker_financials(symbol: str, period: str = Query(default="annual", pattern="^(annual|quarterly)$")) -> dict: + return data_service.get_financials(symbol, period=period) + + @app.get("/api/watchlist", response_model=WatchlistResponse) def get_watchlist() -> dict: items = [] |
