Spaces:
Running
Running
| """ | |
| 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 | |