Search code examples
pythonpython-requestsbinance

How to call Binance /futures/data/openInterestHist Market Data Endpoint?


The documentation states that the request header must contain the api key.

My request looks like this:

import requests

headers = {
    'X-MBX-APIKEY': api_key
}

requests.get('https://binance.com/futures/data/openInterestHist?symbol=BTCUSD&period="5m"&limit=30', headers=headers)

Result is: <Response [400]>

I also tried to send a signed request with the same result.

What am I doing wrong?


Solution

  • https://www.binance.com/futures/data/openInterestHist?symbol=BTCUSDT&period=5m&limit=30

    All the same but without quotation mark. And BTCUSD isn't futures. BTCUSDT is required.