MethJK
MethJK

Reputation: 1

How to get account information via using API Binance in Python

I am trying to get account information by using requests library with the code below.

enter image description here

import requests

url = 'https://api.binance.com'
api_get_info = '/sapi/v1/accountSnapshot'
hmac_sha256 = 'api_key'
get_account_info = requests.get(url+api_get_info+api_get_info)

print(get_account_info.text) 

I have no idea what the url should be like. Could you guys please give me some idea :)

Upvotes: 0

Views: 1180

Answers (1)

Akkie100
Akkie100

Reputation: 11

Binance has an official GitHub repository with examples about these signatures, you can check it out over here: https://github.com/binance/binance-signature-examples/blob/master/python/spot/spot.py

See the function send_signed_request() at the bottom of that file.

Upvotes: 1

Related Questions