ClientError: 400, -1021 - how to resolve it

ClientError: (400, -1021, “Timestamp for this request was 1000ms ahead of the server’s time.”

Hi team,

pleasea dvise how to resolve this as i have see github documentation, but could not find a resolution for the same, as its explained what the error means but how to resolve this time syn mismatch, i guess

thanks in advance
Sukhwant

Hello,

Can you provide us by the way with The ntp servers you’re using please ?

Thanks.

You can take a look at this thread for your issue.

how to increase recvWindow time ? any documentation on that will help

thanks

By using the recvWindow parameter in respective endpoints.

hi Chai,

sorry to ask as i am new to python. i am using below code to get wallet balances.

where to put this recvWindow parameter?

Code:

config_logging(logging, logging.DEBUG)
spot_client = Client(key, secret)
a = spot_client.account()
df = pd.json_normalize(a,“balances”)

thanks in advance
Sukhwant

https://binance-docs.github.io/apidocs/spot/en/#account-information-user_data

spot_client.account(recvWindow=<your_recv_window>)

Hi Chai,

i input the below and its the same error coming with max limit of recvWindow?

a = spot_client.account(recvWindow=60000)

please advise

thanks
Sukhwant

any update as this has not happned from the past 2 months. wonder why its happening now.

thanks in advance
Sukhwant

There a 2 solutions posted in the other thread.
Did you try this solution?
Adjust your local time by synchronizing it with our server time (https://binance-docs.github.io/apidocs/spot/en/#check-server-time 7). For Linux system, you can follow NTP;