Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CoinMarketCapPrice.py
Original file line number Diff line number Diff line change
@@ -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")