# 其他介面

websocket介面是 wss://open-api-ws.bingx.com/market

訂閱賬戶數據流的stream名稱為 /market/<listenKey>

wss://open-api-ws.bingx.com/market/<listenKey>

listenKey 獲取方式如下:

# 生成 Listen Key

listen key的有效時間為1小時

介面

    POST /openApi/user/auth/userDataStream

CURL

curl -X POST 'https://open-api.bingx.com/openApi/user/auth/userDataStream' --header "X-BX-APIKEY:g6ikQYpMiWLecMQ39DUivd4ENem9ygzAim63xUPFhRtCFBUDNLajRoZNiubPemKT"

請求頭參數

參數名 類型 是否必填 備註
X-BX-APIKEY string 請求的API KEY

響應

參數名 類型 備註
listenKey string 返回的
{"listenKey":"a8ea75681542e66f1a50a1616dd06ed77dab61baa0c296bca03a9b13ee5f2dd7"}

# 延長 Listen Key 有效期

有效期延長至本次調用後60分鐘,建議每30分鐘發送一個 ping 。

介面

    PUT /openApi/user/auth/userDataStream
curl -i -X PUT 'https://open-api.bingx.com/openApi/user/auth/userDataStream?listenKey=d84d39fe78762b39e202ba204bf3f7ebed43bbe7a481299779cb53479ea9677d'

請求參數

參數名 類型 是否必填 備註
listenKey string 請求的API KEY

響應

http status 200 成功
http status 204 沒有請求參數
http status 404 沒有這個listenKey

# 關閉 Listen Key

關閉用戶數據流。

介面

    DELETE /openApi/user/auth/userDataStream
curl -i -X DELETE 'https://open-api.bingx.com/openApi/user/auth/userDataStream?listenKey=d84d39fe78762b39e202ba204bf3f7ebed43bbe7a481299779cb53479ea9677d'

請求參數

參數名 類型 是否必填 備註
listenKey string 請求的API KEY

響應

http status 200 成功
http status 204 沒有請求參數
http status 404 沒有這個listenKey
Last Updated: 8/12/2022, 10:06:57 PM