Skip to content

Instantly share code, notes, and snippets.

@sabueso
Created November 15, 2021 15:38
Show Gist options
  • Save sabueso/0bf8ec4ca2ddd7655a13c7e19ba6343b to your computer and use it in GitHub Desktop.
Save sabueso/0bf8ec4ca2ddd7655a13c7e19ba6343b to your computer and use it in GitHub Desktop.
Python3-API Ravencoin wallet balance
#!/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