kalekarnn commited on
Commit
d57be3c
·
verified ·
1 Parent(s): 1c4f4a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -15,9 +15,13 @@ def crypto_currency_price(coin_name:str)-> str:
15
  coin_name: A string representing a name of the crypto currency coin whose price needs to be fetched.
16
  """
17
  try:
18
- endpoint = "https://api.coincap.io/v2/assets/"+ coin_name
 
19
  response = requests.get(endpoint)
 
20
  result = response.json()
 
 
21
  if result and result.data:
22
  return result.data.priceUsd
23
  return "No price found"
 
15
  coin_name: A string representing a name of the crypto currency coin whose price needs to be fetched.
16
  """
17
  try:
18
+ endpoint = f"https://api.coincap.io/v2/assets/{coin_name}"
19
+ print(endpoint)
20
  response = requests.get(endpoint)
21
+ print(response)
22
  result = response.json()
23
+ print("result")
24
+ print(result)
25
  if result and result.data:
26
  return result.data.priceUsd
27
  return "No price found"