-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
TESTNET: binance.exceptions.BinanceAPIException: APIError(code=-2008): Invalid Api-Key ID. #1155
Comments
I got the same error, when I tried to activate the futures trading on testnet with test api key: binance.exceptions.BinanceAPIException: APIError(code=-2008): Invalid Api-Key ID.
Maybe with test api key not allowed futures operations? |
What country are you from? I have the feeling that it is because in my case I am German and it is very unclear what services they operate here or not. |
I'm from Hungary. So maybe that's the case. |
running in the same issue. |
I made a fix and PR for the get_futures_account because there is no check in that function to respect the test net argument. It failed on the requirements file, which is a different issue :-/ kinda bummed out, I really like the library but I feel like it's dead because there is no communication on potentially dangerous issues when they are reported. |
thanks erik404, seems I need to look for an alternative then... |
I'll make a new PR and also fix the margin_account, I wasn't aware that the test net argument was not respected there as well and see what's up with the failing build, give me a couple of hours 🤞 |
worst case we can fork, implement fixes, put it up pip until we get some sort of response from the repo owner |
cool thanks! |
PR request: #1205 edit: Travis CI build fails only on Python 3.7 build on pytest-pep8... other builds are fine. Maybe @sammchardy can have a look? |
Thank you erik404, I will go through your changes and check them out |
I'm still having the same issue: seems to fail here then: :/ |
I see. Thats in the REST API client. The fix I proposed is for the socket connections. I have found a possible solution. Can you confirm that the margin_api_url is the same as the API_TESTNET_URL (https://testnet.binance.vision/api)? |
on the Spot Testnet I don't think /sapi/* endpoints are available including Wallet Endpoints |
Hello I have the problem, I have : client = Client(api_key=YOUR_API_KEY, api_secret=YOUR_API_SECRET Terminal return : But I didn't find the resolution to my problem, have you got an idea ? |
i believe you need API key specially for Testnet. (as far as i remember, i
never used)
Yooo31 ***@***.***> ezt írta (időpont: 2023. jan. 13., P,
12:37):
… Hello I have the problem, I have :
client = Client(api_key=YOUR_API_KEY, api_secret=YOUR_API_SECRET
asset_details = client.get_margin_asset(asset='BNB')
Terminal return :
binance.exceptions.BinanceAPIException: APIError(code=-2008): Invalid
Api-Key ID.
But I didn't find the resolution to my problem, have you got an idea ?
—
Reply to this email directly, view it on GitHub
<#1155 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVKGM4MTQ4TUPKDG72MGJDWSE47PANCNFSM5PX5BXUQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Yes I have link my Github account with testNet binance but I have this error
|
try the API key with other function. ALSO check, if API key is valid on
Bonance API management, because new rule at Binance : certain API KEYS
deleted if no IP restriction on them.
Yooo31 ***@***.***> ezt írta (időpont: 2023. jan. 13., P,
16:19):
… je crois que vous avez besoin d'une clé API spécialement pour Testnet. (
pour autant que je m'en souvienne, je jamais utilisé ) Yooo31 *** @
*. *** > ezt írta ( időpont: 2023. jan. 13., P, 12:37 ): …
<#m_-79705632453120414_> Hello I have the problem, I have : client =
Client(api_key=YOUR_API_KEY, api_secret=YOUR_API_SECRET asset_details =
client.get_margin_asset(asset='BNB') Terminal return :
binance.exceptions.BinanceAPIException: APIError(code=-2008): Invalid
Api-Key ID. But I didn't find the resolution to my problem, have you got an
idea ? — Reply to this email directly, view it on GitHub <#1155 (comment)
<#1155 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABVKGM4MTQ4TUPKDG72MGJDWSE47PANCNFSM5PX5BXUQ
<https://github.com/notifications/unsubscribe-auth/ABVKGM4MTQ4TUPKDG72MGJDWSE47PANCNFSM5PX5BXUQ>
. You are receiving this because you are subscribed to this thread.Message
ID: @.*>
Yes I have link my Github account with testNet binance but I have this
error
—
Reply to this email directly, view it on GitHub
<#1155 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVKGMZDXZVVHWH4JWIX3J3WSFXAZANCNFSM5PX5BXUQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Any updates on this ? I am trying to do a simple operation on testnet after generating the key/secret from here https://testnet.binance.vision/ and the code:
I get |
I can place order (client.futures_create_order(...)) but can't use client.get_all_orders, client.cancel_order, client.get_order... |
bro |
@MaksLuk boy,how do u solve this problem? |
Estou com o mesmo problema e não consigo achar solução em nenhum fórum. |
Hello |
Describe the bug
I tried to connect to the binance testnet and to get the account status, but got the following error:
File "/home/h/anaconda3/envs/pairTrading/lib/python3.9/site-packages/binance/client.py", line 2065, in get_account_status
return self._request_margin_api('get', 'account/status', True, data=params)
File "/home/h/anaconda3/envs/pairTrading/lib/python3.9/site-packages/binance/client.py", line 365, in _request_margin_api
return self._request(method, uri, signed, **kwargs)
File "/home/h/anaconda3/envs/pairTrading/lib/python3.9/site-packages/binance/client.py", line 316, in _request
return self._handle_response(self.response)
File "/home/h/anaconda3/envs/pairTrading/lib/python3.9/site-packages/binance/client.py", line 325, in _handle_response
raise BinanceAPIException(response, response.status_code, response.text)
binance.exceptions.BinanceAPIException: APIError(code=-2008): Invalid Api-Key ID.
I found out, that when I call client.get_account_status(), the client connects to the real binance api and not to the testnet api because it doesn't switch from the real url to the testnet url:
To compare with other requests that works:
To Reproduce
client = Client(config.api_key, config.secret_key, testnet=True)
client.get_account_status()
Expected behavior
Response from the Testnet.
Environment (please complete the following information):
Logs or Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: