简体   繁体   中英

Bybit API (ErrCode: 10002)

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM