feat: company profile endpoint

This commit is contained in:
ryana mittens 2024-09-06 17:45:27 +08:00
parent fd5dbc9f27
commit 21b4ccdc5c

View file

@ -33,3 +33,16 @@ async def quote(symbol: str):
response = requests.get("https://finnhub.io/api/v1/quote", params=params) response = requests.get("https://finnhub.io/api/v1/quote", params=params)
return response.json() return response.json()
@router.get("/profile")
async def profile(symbol: str):
"""
API to get company profile.
"""
params = {
"token": settings.FINNHUB_API_KEY,
"symbol": symbol
}
response = requests.get("https://finnhub.io/api/v1/stock/profile2", params=params)
return response.json()