Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,10 +29,10 @@ url = "https://pro-api.coingecko.com/api/v3/simple/price?&x_cg_demo_api_key=CG-4
|
|
| 29 |
|
| 30 |
response = requests.get(url)
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
print("Failed to retrieve data")
|
| 37 |
|
| 38 |
# Specify the cryptocurrencies you want to check
|
|
|
|
| 29 |
|
| 30 |
response = requests.get(url)
|
| 31 |
|
| 32 |
+
if response.status_code == 200:
|
| 33 |
+
data = response.json()
|
| 34 |
+
return pd.DataFrame(data).T # Transpose for better readability
|
| 35 |
+
else:
|
| 36 |
print("Failed to retrieve data")
|
| 37 |
|
| 38 |
# Specify the cryptocurrencies you want to check
|