Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How get current positions by Binance API, Python

Can someone say how to get current positions by python-binance? Like "WAVESUSDT" on screen.

enter image description here

Here is the documentation, but I can't find there this method. Could someone help me, please? https://python-binance.readthedocs.io/en/latest/account.html#account

like image 857
An Ri Avatar asked Apr 23 '26 13:04

An Ri


2 Answers

Found, yeah!

client = Client(api,key)
client.futures_account()['positions']
like image 175
An Ri Avatar answered Apr 25 '26 02:04

An Ri


I have got the open positions from this url

https://testnet.binancefuture.com/fapi/v2/positionRisk?

(Note if no position is open it will return 2 dummy position)

return await axios
    .get(`https://testnet.binancefuture.com/fapi/v2/positionRisk?symbol=${token_pair}&timestamp=${timestamp}&signature=${signature}`, {
        headers: {
            'Content-Type': 'application/json',
            'X-MBX-APIKEY': api_key
        }
    })
like image 28
Tanjin Alam Avatar answered Apr 25 '26 01:04

Tanjin Alam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!