for example, I send 2 orders on binance swap: buy btcusdt 1.0 and sell ethusdt 2.0 and both are by ‘limit’ orders; I want to get the info by api for any trading on them, such as btcusdt 0.5, eth 0.2; how shall I write the code, shall I get an demo?
I know I should use this link ‘Binance API 使用文档’, but I don’t know the exact details.
There is no websocket stream for Swap order changes. You can get relevant order data from the Swap History endpoint.
https://binance-docs.github.io/apidocs/spot/en/#get-swap-history-user_data
1 Like
Hi tantialex
thanks for your reply;
I am not familar with this development, and I guess I should use the url like this ‘Buy/Sell Bitcoin, Ether and Altcoins | Cryptocurrency Exchange | Binance(HMAC SHA256)’;
then my question is that:
- how to generate my HMAC SHA256, could you show a demo?
- requests.get(this url) to get swap holding?
- how many time I can get this data after I post a new order?
- how to generate my HMAC SHA256, could you show a demo?
You can find samples of generating the signature in different languages here.
- requests.get(this url) to get swap holding?
You can find a sample example of Get Swap History in our official connectors.
Python Example
Other connectors
- how many time I can get this data after I post a new order?
It’s available right after the order is sent. However it will remain pending until it is matched. This time frame is unknown.
1 Like