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

KucoinAPIException 400003: KC-API-KEY not exists #115

Open
BaseMax opened this issue May 30, 2022 · 1 comment
Open

KucoinAPIException 400003: KC-API-KEY not exists #115

BaseMax opened this issue May 30, 2022 · 1 comment

Comments

@BaseMax
Copy link

BaseMax commented May 30, 2022

from kucoin.client import Client

api_key = 'xxxxxxxxxxxxxxxxxxxxxxxx'
api_secret = 'xxxxxxxxxxxxxxxxxxxxxxxx'
api_passphrase = 'xxxxxxxxxxxxxxxxxxxxxxxx'

client = Client(api_key, api_secret, api_passphrase)
# client = Client(api_key, api_secret, api_passphrase, sandbox=True)

# get currencies
currencies = client.get_currencies()
print(currencies)

# open a new order
order = client.create_market_order('KCS', Client.SIDE_BUY, size=5)
print(order)

image

Error

Traceback (most recent call last):
  File "C:\Users\MAX\Documents\trade.py", line 15, in <module>
    order = client.create_market_order('KCS', Client.SIDE_BUY, size=5)
  File "C:\Users\MAX\AppData\Local\Programs\Python\Python310\lib\site-packages\kucoin\client.py", line 942, in create_market_order
    return self._post('orders', True, data=data)
  File "C:\Users\MAX\AppData\Local\Programs\Python\Python310\lib\site-packages\kucoin\client.py", line 192, in _post
    return self._request('post', path, signed, api_version, **kwargs)
  File "C:\Users\MAX\AppData\Local\Programs\Python\Python310\lib\site-packages\kucoin\client.py", line 160, in _request
    return self._handle_response(response)
  File "C:\Users\MAX\AppData\Local\Programs\Python\Python310\lib\site-packages\kucoin\client.py", line 170, in _handle_response
    raise KucoinAPIException(response)
kucoin.exceptions.KucoinAPIException: KucoinAPIException 400003: KC-API-KEY not exists

Why it's not possible to open a new order?

Thank you for any kind of help in advance.

@Alireza-Pourreza
Copy link

Alireza-Pourreza commented Jun 25, 2022

In your account, delete your API-KEY and create agian

besides, for the following command:
order = client.create_market_order('KCS', Client.SIDE_BUY, size=5)

i think you should define pair of KCS, for example:
order = client.create_market_order('KCS-USDT', Client.SIDE_BUY, size=5)

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

2 participants