Bitcoin Alert System Code problem

I couldn’t run the code shown successfully. I am unable to figure out what went wrong.

P.S.: Does anybody have a clue how to copy paste a code in vmware?

@kanakkharbanda
you have to provide the variable where you have to store the values for your desired output
querystring = {“fysm”:“BTC”, “tsyms”:“USD”}
still not clear then go through the link provided
https://www.hackster.io/rahulkumarsingh/crypto-alert-system-using-bolt-iot-d62df1

Thank you for the help but I’m still facing a few troubles. Could you help me resolve it?

@kanakkharbanda
you have entered the wrong URL. Your URL should be look like this as per your requirement.
https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=INR
If this solves your problem do let me know.


The problem still exists.

@kanakkharbanda
error is the arrow marked instead of fsym you have mention fsyms which gives you the error

your get_bitcoin_price() can be written in 2 ways:
No.1
def get_bitcoin_price():
URL = “https://min-api.cryptocompare.com/data/price
querystring = {“fsym”:“BTC”, “tsyms”:“INR”}
response = requests.request(“GET”,URL, params=querystring)
response = json.loads(response.text)
current_price = response[‘INR’]
return current_price

No.2
def price_check():
URL = “https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD
querystring = {“fysm”:“BTC”, “tsyms”:“USD”}
response = requests.request(“GET”,URL, params=querystring)
response = json.loads(response.text)
current_price = response[“USD”]
return current_price

Hope this will help you. Do let me know.

Thank you so much that worked but now the only prob is it is unable to send the message on telegram.There was that typing error . thank you for resolving it.

@kanakkharbanda
check the bot_id and chat_id once again for typo-error because lot of this type of error are coming due to the configuration in providing bot_id and chat_id.
This this error persist then share me the whole code.