Search code examples
pythonbinance

python-binance: Get all orders, without specifying symbol


Trying to fetch my Binance accounts order history with the python-binance module. There is an option to get all orders within one symbol (see documentation):

orders = client.get_all_orders(symbol='BNBBTC', limit=10)

Bu the problem is I can't pass more than 1coin in the symbol parameter How can I pass a list for the symbol parameter, I want to fetch more than 1 coins order history in a single function as I'm trying to build a portfolio for my Binance account. Or is there another method to do so?


Solution

  • Currently it is not possible to get all historical orders or trades without specifying the symbol in one call, even without the module python-binance.

    There is an ongoing discussion on the Binance forum, requesting this feature.


    As a workaround:

    • If you know your ordered symbols: Use the function get_all_orders() multiple times for each symbol in a loop.
    • If you don't know your ordered symbols: you could send a GET request for each symbol available at Binance (as mentioned in the discussion linked above). But be careful with the rateLimits.