首页 > 解决方案 > 币安python获取api

问题描述

这是我要下载的多空比率的描述

https://binance-docs.github.io/apidocs/futures/en/#long-short-ratio

在那个网站,有一句话:GET /futures/data/globalLongShortAccountRatio

请告诉我 Python 中的代码(导入请求),例如“BTCUSDT”、“5M” CASE

标签: pythonapi

解决方案


不知道你到目前为止做了什么,但这可能会帮助你我认为:

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

推荐阅读