FIN_ASSISTANT / core /data_coinlore.py
QAway-to
New tabs and functions v2.0
e7eba34
raw
history blame
425 Bytes
"""
Coinlore API Handler – market overview
"""
import requests, pandas as pd
def get_coinlore_data():
url = "https://api.coinlore.net/api/tickers/"
data = requests.get(url).json()["data"]
df = pd.DataFrame(data)
df["price_usd"] = df["price_usd"].astype(float)
df["market_cap_usd"] = df["market_cap_usd"].astype(float)
df["percent_change_24h"] = df["percent_change_24h"].astype(float)
return df