Good afternoon!
I am a very new python programmer who is mainly self-taught and am 4 weeks into a college python course. I'm working on a personal python project that needs me to take a part of an API response and use it to make a variable. The data I get is
{'id': '3f69d086-530e-401e-8b30-xxxxxxxxxxxx',
'currency': 'BTC',
'balance': '9.0987318000000000',
'hold': '0.0000000000000000',
'available': '9.0987318',
'profile_id': '3945058c-8681-4c8b-a69e-xxxxxxxxxxxx',
'trading_enabled': True
}
and I need to assign the balance to a variable "coins".
If anyone has any suggestions as to go about this, I'd be greatly appreceated!
Thanks!
EDIT:
So far I've got this:
account_resposne = auth_client.get_account("3f69d086-530e-401e-8b30-xxxxxxxxxxxx")
data = account_resposne.json()
coins = data["balance"]
print(coins)
but it keeps giving me an error of
data = account_resposne.json()
AttributeError: 'dict' object has no attribute 'json'