Search code examples
pythonbinance

binance-python: How to get futures symbol data?


I see a function in client.py called futures_exchange_info(self). What is self here? The documentation is really slim but I'm assuming it refers to Exchange Information? How does this function work exactly? I've tried calling it as futures_exchange_info('VETUSDT') but I just get the error: "TypeError: futures_exchange_info() takes 1 positional argument but 2 were given".

Does anyone know how this function works?


Solution

  • You need to create a Client object and then call client.futures_exchange_info(). The method takes no parameters and according to the documentation returns "Current exchange trading rules and symbol information".

    Something like this should work:

    from binance.client import Client
    
    client = Client(api_key, api_secret)
    info = client.futures_exchange_info()
    

    Documentation is here and take a look at the quick start.