title: Binance REST API Timestamp for this request is outside of the recvWindow
body: <p>I started testing out the Binance REST API recently but have been unable to get any account info. I consistently receive the same error <em>Code -1021 Timestamp for this request is outside of the recvWindow</em>. Not sure what the issue could be. I have triple checked that my system is synced with NTP and it matches that of other systems. I have tried increasing the default recvWindow to 50 seconds instead of the default 5 seconds but no luck. I should receive a JSON response as shown in the API documentation. I pasted my bash script below.</p>
  
  <p><a href="https://www.binance.com/restapipub.html" rel="noreferrer">https://www.binance.com/restapipub.html</a></p>
  
  <p><strong>Updated Working Code</strong></p>
  
  <pre><code>#!/bin/bash
  
  APIKEY="&lt;PUBLIC-KEY-HERE&gt;"
  APISECRET="&lt;SECRET-KEY-HERE&gt;"
  RECVWINDOW=5000 # 5 seconds    
  
  RECVWINDOW='recvWindow='$RECVWINDOW
  TIMESTAMP=$(( $(date +%s) *1000))
  TIMESTAMP='timestamp='$TIMESTAMP
  
  QUERYSTRING=$RECVWINDOW"&amp;"$TIMESTAMP
  
  SIGNATURE=`echo -n $QUERYSTRING | openssl dgst -sha256 -hmac $APISECRET`
  SIGNATURE=`echo $SIGNATURE|cut -c 10-`
  SIGNATURE='signature='$SIGNATURE
  
  
  curl -H "X-MBX-APIKEY: $APIKEY" -X GET 'https://api.binance.com/api/v3/account?'$RECVWINDOW'&amp;'$TIMESTAMP'&amp;'$SIGNATURE
  
  echo
  echo RecvWindow:$RECVWINDOW
  echo Timestamp:$TIMESTAMP
  echo Signature:$SIGNATURE
  echo
  </code></pre>