I have a piece of code like below
url = "https://blockchain.info/balance?active="+pub
r = requests.get(url)
print(r.json())
above code prints below output
{u'0jhke23k23k4j4k3434kk54l54': {u'final_balance': 0, u'n_tx': 0, u'total_received': 0}}
all I want is the final_balance
and total_received
I tried below code
print("{} {:20} {:20}".format(pub, r.json()['final_balance'], r.json()['total_received']']))
but it gives me this error
KeyError: 'final_balance'
so how to get only final_balance
from this output --> {u'0jhke23k23k4j4k3434kk54l54': {u'final_balance': 0, u'n_tx': 0, u'total_received': 0}}
??