sammchardy / python-binance

Binance Exchange API python implementation for automated trading
https://python-binance.readthedocs.io/en/latest/
MIT License
5.91k stars 2.19k forks source link

Error with client.futures_open_interest() #541

Open slurpxbt opened 4 years ago

slurpxbt commented 4 years ago

Describe the bug I have an issue with getting open interest data from binance. With getting other data I have no issues but when I want to get futures_open_interest I get -> binance.exceptions.BinanceAPIException: APIError(code=0): Invalid JSON error message from Binance: <!DOCTYPE html> . It seems like it is issue on binance side since other functions work properly

To Reproduce client = Client(api_key="None", api_secret="None") oi = client.futures_open_interest(symbol="BTCUSDT")

Expected behavior this code should return open interest data in json format

Environment (please complete the following information):

Logs or Additional context File "C:\Python\anaconda\lib\site-packages\binance\client.py", line 230, in _handle_response
raise BinanceAPIException(self.response) binance.exceptions.BinanceAPIException: APIError(code=0): Invalid JSON error message from Binance: <!DOCTYPE html>

Binance

åºéå¦ï¼æ¨è®¿é®çç½é¡µä¸å­¨ã

Sorry! The page ç½é¡µä¸å­¨ã

Sorry! The page youâre looking for cannot be found.

2pd commented 4 years ago

https://github.com/sammchardy/python-binance/blob/master/binance/client.py#L3560 the endpoint is not correct

GET /fapi/v1/openInterest