Binance API:如何使用API获取Binance用户ID
如何使用 API 获取币安用户 ID。我刚刚创建了一个机器人,我需要独特的值来创建机器人激活,以便用户只能将我的机器人用于该帐户。
这就是为什么我需要 Binance API 的用户 ID。如何通过 API 获取用户 ID 或获取任何其他唯一值(例如用户 ID)。
How to get Binance User ID using API. I just created a bot and I need unique value to create a bot activation so a user can use my bot only for that account.
That is why I need a User ID by Binance API. How can I get a User ID or get any other unique value like a User ID by API.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
出于隐私原因,币安不会共享每个用户的任何唯一 ID。
您可以通过查询每个 API 密钥的余额来部分绕过此限制。如果两个 API 密钥具有相同的余额集,则很可能是同一用户。请注意,该解决方案不易扩展。对于数千个用户,您将必须运行数千个请求才能获取他们的余额。并且可能会缓存这些结果,这样您就不会遇到速率限制(来自服务器 IP 的 API 请求数量),这会带来另一个不准确的情况。
Binance does not share any unique ID of each user, most likely for privacy reasons.
You can partially bypass this limitation by querying balances of each API key. If there are two API keys with the same set of balances, chances are it's the same user. Mind that this solution is not easily scalable. With thousands of users you'll have to run thousands of requests to get their balances. And probably cache these results, so that you don't run into rate limits (number of API requests from your server IP), which introduces another inaccuracies.
您可以通过用户余额查询“/fapi/v2/balance”。每个余额都有“accountAlias”字段,正如 Binance API 文档所述,该字段对于每个用户来说都是唯一的
You can query "/fapi/v2/balance" with User's Balances. Every Balance has field "accountAlias", which is unique per user as Binance API Docs states
我还没有尝试过,但下一个 API 会给你一个 UID,它应该识别用户:
https://binance-docs.github.io/apidocs/spot/en/#account-information-user_data
I haven't tried yet but next API gives you an UID which should identify the user:
https://binance-docs.github.io/apidocs/spot/en/#account-information-user_data