I have an issue with Python's Pybit module. I'm trying to get my wallet balance but I get the following error:
pybit.exceptions.FailedRequestError: Http status code is not 200. (ErrCode: 404) (ErrTime: 07:32:08)
My code:
from pybit.unified_trading import HTTP
# API credentials
api_key = 'xxx'
secret_key = 'xxx'
session = HTTP(
testnet=True,
api_key=api_key,
api_secret=secret_key,
)
print(session.get_wallet_balance(
accountType="UNIFIED",
coin="BTC",
))
What should I do?
May be this official link https://bybit-exchange.github.io/docs/v5/account/wallet-balance can help you.
My working code is
And check permissions of API-key :)