python - 币安python获取api
问题描述
这是我要下载的多空比率的描述
https://binance-docs.github.io/apidocs/futures/en/#long-short-ratio
在那个网站,有一句话:GET /futures/data/globalLongShortAccountRatio
请告诉我 Python 中的代码(导入请求),例如“BTCUSDT”、“5M” CASE
解决方案
不知道你到目前为止做了什么,但这可能会帮助你我认为:
def get_global_long_short_accounts(self, symbol: 'str', period: 'str', startTime: 'str' = None, endTime: 'str' = None, limit: 'int' = 30) -> any:
"""
Long/Short Ratio (MARKET_DATA)
GET /futures/data/globalLongShortAccountRatio
"""
response = call_sync(self.request_impl.get_global_long_short_accounts(symbol, period, startTime, endTime, limit))
self.refresh_limits(response[1])
return response[0]
可以在这里阅读:
https://github.com/Binance-docs/Binance_Futures_python/blob/master/binance_f/requestclient.py
https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md
推荐阅读
- php - 为什么 PHP 在我的 HTML 中间放一个随机数?
- javascript - 在 React 钩子中切换对象状态内的值的正确方法是什么?
- c - Cs50 pset1 积分
- azure - 如何获取 Azure 应用程序网关 HTTPS 侦听器的证书
- c - 如何在不复制最后输入的命令的情况下从标准输入读取?
- flutter - 构建APK时没有flutter_local_notification通知
- itext7 - .NET 的 iText7 在从 HTML 到 PDF 的转换中不包含图像
- c++ - CMake 错误:CMake 无法找到与“Unix Makefiles”对应的构建程序
- reactjs - 处理用 TypeScript 编写的 React 功能组件中的 Ref:Element is not assignable 错误
- android - 我们可以避免 stopForeground 停止服务吗