SnowHA commited on
Commit
488dd70
·
verified ·
1 Parent(s): fe73742

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 = web_search(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 {price}"
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