User Data Streams Connect
-
The base API endpoint is: https://dapi.binance.com
-
A User Data Stream
listenKeyis valid for 60 minutes after creation. -
Doing a
PUTon alistenKeywill extend its validity for 60 minutes, if response-1125error "This listenKey does not exist." Please usePOST /dapi/v1/listenKeyto recreatelistenKey. -
Doing a
DELETEon alistenKeywill close the stream and invalidate thelistenKey. -
Doing a
POSTon an account with an activelistenKeywill return the currently activelistenKeyand extend its validity for 60 minutes. -
There are two connection methods for Websocket:
-
Base Url 1: wss://dstream.binance.com
-
User Data Streams are accessed at /ws/<listenKey>
-
Example:
wss://dstream.binance.com/ws/XaEAKTsQSRLZAGH9tuIu37plSRsdjmlAVBoNYPUITlTAko1WI22PgmBMpI1rS8Yh -
Base Url 2: wss://dstream-auth.binance.com
-
User Data Streams are accessed at /ws/<listenKey>?listenKey=<validateListenKey>
-
<validateListenKey> must be a valid listenKey when you establish a connection
-
Example:
-
wss://dstream-auth.binance.com/ws/XaEAKTsQSRLZAGH9tuIu37plSRsdjmlAVBoNYPUITlTAko1WI22PgmBMpI1rS8Yh?listenKey=XaEAKTsQSRLZAGH9tuIu37plSRsdjmlAVBoNYPUITlTAko1WI22PgmBMpI1rS8Yh
-
-
For one connection(one user data), the user data stream payloads can guaranteed to be in order during heavy periods; Strongly recommend you order your updates using E
-
A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark