diff --git a/CoinMarketCapPrice.py b/CoinMarketCapPrice.py new file mode 100644 index 0000000..3bedba1 --- /dev/null +++ b/CoinMarketCapPrice.py @@ -0,0 +1,13 @@ +import requests, json + +while True: + print('use ctrl+c or type EXIT to close the script') + fiat = input("Provide fiat name eg: USDT, BUSD\t\t\t\t") + symbol = input("Provide crypto symbol eg: BTC, ETH, BNB\t\t\t") + endpoint = "https://3rdparty-apis.coinmarketcap.com/v1/cryptocurrency/widget?convert={}&symbol={}".format(fiat, symbol) + response = requests.get(endpoint) + + if response.status_code==200: + print(json.dumps(json.loads(response.text), indent=4)) + else: + print("Oop! Something went wrong. Invalid request query input") \ No newline at end of file