diff --git a/app/api/v1/routes/stock.py b/app/api/v1/routes/stock.py index 4f6a300..8729c24 100644 --- a/app/api/v1/routes/stock.py +++ b/app/api/v1/routes/stock.py @@ -19,4 +19,17 @@ async def lookup(query: str, exchange: str | None = None): params["exchange"] = exchange response = requests.get("https://finnhub.io/api/v1/search", params=params) - return response.json() \ No newline at end of file + return response.json() + +@router.get("/quote") +async def quote(symbol: str): + """ + API to get a stock quote. + """ + params = { + "token": settings.FINNHUB_API_KEY, + "symbol": symbol + } + + response = requests.get("https://finnhub.io/api/v1/quote", params=params) + return response.json()