pythonbinance-api-clientpython-binance

Python binance - get futures position information


I would like to retrieve future position histroy from the Binance API, just like it is on the dashboard.

I need this data to then later display on a spreadsheet.

position history

Thank you.

I've tried to play with the client.futures_account_trades().

client.futures_position_information() retrieves only currently active position.


Solution

  • After 3 months of research I found that there’s no endpoint to return all those fields together, user needs to program locally.

    I would suggest you to explore the available endpoints at the Futures API document first, namely: https://binance-docs.github.io/apidocs/futures/en/#account-trade-list-user_data

    or if using Websocket Stream: https://binance-docs.github.io/apidocs/futures/en/#event-balance-and-position-update

    And test their behavior with your Futures Testnet Account, which can be created at: https://testnet.binancefuture.com/en/futures/ADAUSDT After created, you can obtain the API Key/ API secret key in the “API key” tab below.