Hey I am having an issue with getting futures open interest from binance api. I think the error is on binance side since every other endpoint works well(mark price, funding…).
code to recreate error:
from binance.client import Client
client = Client(api_key, api_secret)
oi = client.futures_open_interest(symbol="BTCUSDT")
error I get:
binance.exceptions.BinanceAPIException: APIError(code=0): Invalid JSON error message from Binance
- some html
what should this code return:
data about open interest in json format
for example:
mark = client.futures_mark_price(symbol="BTCUSDT")
above code returns this:
{‘symbol’: ‘BTCUSDT’, ‘markPrice’: ‘9153.01075457’, ‘lastFundingRate’: ‘0.00010000’, ‘nextFundingTime’: 1593072000000, ‘time’: 1593069849000}
OS: Windows
Lang.: python 3.7.6
package needed for this to work -> python-binance
edit:
I also tried SDK provided from binance(output here works) but I still think there is some kind of an error on binance side since ouptut is different from the data provided on binance website.
from api I get OI around 6000(red circles on img) but on the website the OI is around 38000
link to futures oi on website: https://www.binance.com/en/futures/funding-history/0