Add full-stack BTC portfolio web app
Multi-user FastAPI + React app with JWT auth, SQLite storage, and CoinGecko price integration. Dockerized with docker-compose. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import requests
|
||||
|
||||
|
||||
def get_btc_price_eur() -> float:
|
||||
try:
|
||||
resp = requests.get(
|
||||
"https://api.coingecko.com/api/v3/simple/price",
|
||||
params={"ids": "bitcoin", "vs_currencies": "eur"},
|
||||
timeout=10,
|
||||
)
|
||||
resp.raise_for_status()
|
||||
return float(resp.json()["bitcoin"]["eur"])
|
||||
except Exception:
|
||||
return 0.0
|
||||
Reference in New Issue
Block a user