python-binance icon indicating copy to clipboard operation
python-binance copied to clipboard

binance.us some endpoints do not work

Open aosavas opened this issue 3 years ago • 4 comments

Describe the bug Some of the endpoints do not work with binance.us. For ex: get_account_api_permissions()

To Reproduce client = Client(api_key, api_secret, tld = "US") client.get_all_orders(symbol='BNBBTC') <---WORKS client.get_account_api_trading_status() <--- DOES NOT WORK

Traceback (most recent call last): File "", line 1, in File "/home/ubuntu/.local/lib/python3.8/site-packages/binance/client.py", line 2146, in get_account_api_trading_status return self._request_margin_api('get', 'account/apiTradingStatus', True, data=params) File "/home/ubuntu/.local/lib/python3.8/site-packages/binance/client.py", line 364, in _request_margin_api return self._request(method, uri, signed, **kwargs) File "/home/ubuntu/.local/lib/python3.8/site-packages/binance/client.py", line 315, in _request return self._handle_response(self.response) File "/home/ubuntu/.local/lib/python3.8/site-packages/binance/client.py", line 324, in _handle_response raise BinanceAPIException(response, response.status_code, response.text) File "/home/ubuntu/.local/lib/python3.8/site-packages/binance/exceptions.py", line 14, in init self.code = json_res['code'] KeyError: 'code'

Environment (please complete the following information):

  • Python 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0] on linux
  • OS: Ubuntu
  • python-binance version: 1.0.16

Logs or Additional context Not sure if it works .com as I do not have a ".com" account but there are multiple endpoints that are listed and not working.

aosavas avatar Jun 06 '22 14:06 aosavas

Getting the same error for several endpoints as well -- also using the .us API w/o a .com account to confirm.

Currently known issues with the following:

get_trade_fee with either the symbol kwarg or not.

get_account_api_trading_status

Upon inspection, the raw JSON return is similar to the following:

{'timestamp': removed, 'status': 404, 'error': 'Not Found', 'message': 'No message available', 'path': '/sapi/v1/asset/assetDetail'}

Notably, there is no 'code' key nor is there a 'msg' key (looking at line 15 in exceptions.py in the BinanceAPIException class which would be executed directly after the json_res['code'] portion.

alphazwest avatar Aug 17 '22 02:08 alphazwest

Has there been any update on this?

psych0v0yager avatar Dec 06 '22 06:12 psych0v0yager

Same issue here with get_account() , the docs at https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#account-information-user_data reference a v3 uri

jbsmithj1981 avatar Apr 01 '23 03:04 jbsmithj1981