简体   繁体   English

如何在Python使用API Binance获取账户信息

[英]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.我不知道 url 应该是什么样子。 Could you guys please give me some idea:)你们能给我一些想法吗:)

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 Binance 有一个官方的 GitHub 存储库,其中包含有关这些签名的示例,您可以在这里查看: 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.请参阅该文件底部的 function send_signed_request()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM