mirror of
https://github.com/ryanamay/sparkle.git
synced 2024-09-20 05:50:33 +00:00
Compare commits
2 commits
b3fa44b673
...
39f67b45de
Author | SHA1 | Date | |
---|---|---|---|
39f67b45de | |||
a0d98b197f |
1 changed files with 14 additions and 1 deletions
|
@ -20,3 +20,16 @@ async def lookup(query: str, exchange: str | None = None):
|
|||
|
||||
response = requests.get("https://finnhub.io/api/v1/search", params=params)
|
||||
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()
|
||||
|
|
Loading…
Reference in a new issue