Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FailedRequestError pybit #140

Open
sssyrbu opened this issue Apr 28, 2023 · 6 comments
Open

FailedRequestError pybit #140

sssyrbu opened this issue Apr 28, 2023 · 6 comments

Comments

@sssyrbu
Copy link

sssyrbu commented Apr 28, 2023

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? I’m using Python 3.11

@andreas778
Copy link

andreas778 commented Apr 28, 2023

same problem, I’m using Python 3.9.1

@dextertd
Copy link
Collaborator

This happens when you specify an accountType you don't have, so if you send UNIFIED that means you're account is not unified. Bybit is going to improve the error handling for this case.

@IsaTTeN
Copy link

IsaTTeN commented May 27, 2023

same problem here, even if I'm not using accountType I get an error. Did you manage to get the balance?

@leoxama
Copy link

leoxama commented Aug 31, 2023

I've got the same issue. Has anyone found a solution?

@dextertd
Copy link
Collaborator

Please note that accounType is a required parameter and you must pass the correct value to it. Otherwise, you will face this error. Please provide the request you sent if you still face this error.

https://bybit-exchange.github.io/docs/v5/account/wallet-balance

@jaekyung-you
Copy link

I solved it!
If you set up 'testnet=True', you have to use "Testnet" API Key and API Secret.
https://testnet.bybit.com/en/ -> you should get api key and secret on this website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants