Created
November 15, 2021 15:38
-
-
Save sabueso/0bf8ec4ca2ddd7655a13c7e19ba6343b to your computer and use it in GitHub Desktop.
Python3-API Ravencoin wallet balance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import requests | |
#Wallet | |
api_url = "https://ravencoin.network/api/addr/<your_wallet_addr_here>/?noTxList=1" | |
balance = requests.get(api_url).json()['balance'] | |
#Coti | |
api_url2 = "https://ravencoin.network/api/markets/info" | |
price = requests.get(api_url2).json()['price_usd'] | |
#Debug | |
#print ("R=> %s" %(balance)) | |
#print ("P=> %s" %(price)) | |
calc = float(price) * float(balance) | |
print("[W=>%s | $=>%s]" %(round(balance), round(calc))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment