Binance | Private Requests Time

When you do a private request to Binance, the message is signed so increase the security of requests. The message takes the local time and sends inside the signed message, if the local time has a difference greater than 5 seconds with Binance servers, the request will be rejected. So, it's important verify that your local time is synchronized, you can do this using the synchronization time method for your OS.

 

The logic is as follows:

 

if (timestamp < (serverTime + 1000) && (serverTime - timestamp) <= recvWindow) {
  // process request
} else {
  // reject request
}

 

It is recommended to use a small recvWindow of 5000 or less! The max cannot go beyond 60000 milliseconds.

 

You can check the Binance server time, calling method GetServerTime, which will return the time of the Binance server

 

The RecvWindow defaults to 5000, this value can be increased using the property REST_API.BinanceOptions.RecvWindow.