Bybit API (ErrCode: 10002)

2k Views Asked by At

Just trying to interact with the API, but I am getting a specific error when trying the simplest tasks such as getting the balance.

Example Code

import API_Login as apiLogin
from pybit.usdt_perpetual import HTTP


apiKey = apiLogin.api_key

apisecret = apiLogin.api_secret

session = HTTP(
    endpoint="https://api.bybit.com", 
    api_key= apiKey,
    api_secret= apisecret)

session.get_wallet_balance(coin="USDT")

The error I receive:

2022-09-26 15:31:49 - pybit._http_manager - ERROR - invalid request, please check your timestamp and recv_window param. 
req_timestamp: 1664231507914 server_timestamp: 1664231504913 recv_window: 5000 (ErrCode: 10002). Added 2.5 seconds to recv_window. 2 retries remain.

Error code 10002 is defined: Request not authorized - an API key is required and should be included in all requests.

But I know my API information is valid.

1

There are 1 best solutions below

0
Runner On

Figured out that my system clock was not synced properly. Hit the Sync Now button and it works perfectly.