coinbasepro-python icon indicating copy to clipboard operation
coinbasepro-python copied to clipboard

pro.coinbase.com/orders - request timestamp expired

Open Bandit253 opened this issue 2 years ago • 1 comments

The endpoint was working fine for weeks many thousands of successful trades done against it. then all of a sudden, on Monday, for no apparent reason I only get this response. POST (401) https://api-public.sandbox.pro.coinbase.com/orders - request timestamp expired

Another odd thing it has affected my non Sandbox API calls. image

Bandit253 avatar Jul 30 '21 08:07 Bandit253

The CB-ACCESS-TIMESTAMP header MUST be number of seconds since Unix Epoch in UTC. Decimal values are allowed.

Your timestamp must be within 30 seconds of the api service time or your request will be considered expired and rejected. We recommend using the time endpoint to query for the API server time if you believe there many be time skew between your server and the API servers.

Source

The code is generating a timestamp in cbpro_auth on line 16 once a request is made.

The only thing I can think of is that your request timestamp is skewed. There's ways to mitigate it, but I've never had this issue.

The docs provide a suggestion by modififying the timestamp so that the skew doesn't interfere with the request.

teleprint-me avatar Aug 09 '21 13:08 teleprint-me