Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,11 +38,11 @@ def get_crypto_price(crypto: str, currency: str) -> str:
|
|
| 38 |
"""
|
| 39 |
url = f"https://api.coingecko.com/api/v3/simple/price?ids={crypto}&vs_currencies={currency}"
|
| 40 |
try:
|
| 41 |
-
response =
|
| 42 |
response.raise_for_status()
|
| 43 |
data = response.json()
|
| 44 |
price = data.get(crypto, {}).get(currency, "N/A")
|
| 45 |
-
return f"The current price of {crypto} in {currency} is {
|
| 46 |
except requests.RequestException as e:
|
| 47 |
return f"Error fetching price: {e}"
|
| 48 |
|
|
|
|
| 38 |
"""
|
| 39 |
url = f"https://api.coingecko.com/api/v3/simple/price?ids={crypto}&vs_currencies={currency}"
|
| 40 |
try:
|
| 41 |
+
response = requests.get(url)
|
| 42 |
response.raise_for_status()
|
| 43 |
data = response.json()
|
| 44 |
price = data.get(crypto, {}).get(currency, "N/A")
|
| 45 |
+
return f"The current price of {crypto} in {currency} is {currency}"
|
| 46 |
except requests.RequestException as e:
|
| 47 |
return f"Error fetching price: {e}"
|
| 48 |
|