python-binance icon indicating copy to clipboard operation
python-binance copied to clipboard

How to use websocket request with private key ?

Open zhangk opened this issue 1 year ago • 5 comments

I applied for an Ed25519 API key, but I don't know how to use this API key for websocket requests.

zhangk avatar Dec 25 '24 02:12 zhangk

Hello @zhangk, you have several examples in the docs, but basically you just need to do:


api_key = "TwEW0XXXXXXXXXXXXXXXXXXXXXXXXXX"  # your api_key here
privateKey = "-----BEGIN PRIVATE KEY-----\nMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n-----END PRIVATE KEY-----"

client = AsyncClient(api_key, private_key=privateKey)

carlosmiei avatar Dec 28 '24 11:12 carlosmiei

This does not work for me. Could you please provide a full example? Can't get it running.

PGSch avatar Mar 21 '25 21:03 PGSch

@PGSch What's your python-binance version?

carlosmiei avatar Mar 22 '25 14:03 carlosmiei

1.0.28

PGSch avatar Mar 22 '25 21:03 PGSch

@PGSch that's the latest, what's the issue exactly?

carlosmiei avatar Mar 23 '25 15:03 carlosmiei