question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't make POST requests for Kucoin

See original GitHub issue

Can’t seem to make POST requests on Kucoin, it says that “Signature verification failed”. All GET requests have worked fine so far.

  • OS: Mac OS
  • Programming Language: Python (ipynb format)
  • CCXT version: 1.10
  • Exchange: Kucoin
  • Method: create_order
ku_client.create_order('LTC/BTC', 'limit', 'buy', .01, 0.01655)



Result:
AuthenticationError: kucoin {"msg":"Signature verification failed","timestamp":1514554308458,"code":"UNAUTH","success":false}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:27 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
gaardiolorcommented, Dec 29, 2017

Yeah, they’re having load issues. Sometimes that page works, (it does for me at the moment). Some more info when that page works:

import ccxt
import test_config as config
from pprint import pprint
import time

e = ccxt.kucoin()
e.apiKey = config.exchange_keys['kucoin']['key']
e.secret = config.exchange_keys['kucoin']['secret']
e.timeout = 60000
e.proxies = {'http': 'http://localhost:8080',
             'https': 'http://localhost:8080'}
balances = e.fetch_balance()
print(balances['ETH'])
time.sleep(1)
e.createLimitSellOrder('ETH/BTC', 0.00059940, 0.04978104)


C:\Users\gaardiolor\Anaconda3\python.exe C:/Users/gaardiolor/PycharmProjects/Test2/_test/test_kucoin.py
{'free': 0.0005994, 'used': 0.0, 'total': 0.0005994}
Traceback (most recent call last):
  File "C:\Users\gaardiolor\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 345, in fetch_requests
    response.raise_for_status()
  File "C:\Users\gaardiolor\Anaconda3\lib\site-packages\requests\models.py", line 935, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error:  for url: https://api.kucoin.com/v1/order

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/gaardiolor/PycharmProjects/Test2/_test/test_kucoin.py", line 15, in <module>
    e.createLimitSellOrder('ETH/BTC', 0.00059940, 0.04978104)
  File "C:\Users\gaardiolor\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 1050, in create_limit_sell_order
    return self.create_order(symbol, 'limit', 'sell', *args)
  File "C:\Users\gaardiolor\Anaconda3\lib\site-packages\ccxt\kucoin.py", line 298, in create_order
    response = self.privatePostOrder(self.extend(order, params))
  File "C:\Users\gaardiolor\Anaconda3\lib\site-packages\ccxt\kucoin.py", line 471, in request
    response = self.fetch2(path, api, method, params, headers, body)
  File "C:\Users\gaardiolor\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 290, in fetch2
    return self.fetch_requests(request['url'], request['method'], request['headers'], request['body'])
  File "C:\Users\gaardiolor\Anaconda3\lib\site-packages\ccxt\base\exchange.py", line 357, in fetch_requests
    self.handle_errors(response.status_code, response.reason, url, method, None, self.last_http_response)
  File "C:\Users\gaardiolor\Anaconda3\lib\site-packages\ccxt\kucoin.py", line 465, in handle_errors
    raise AuthenticationError(self.id + ' ' + self.json(response))
ccxt.base.errors.AuthenticationError: kucoin {"code":"UNAUTH","msg":"Signature verification failed","success":false,"timestamp":1514555842503}

So fetching (also using private api) works, placing orders doesn’t work.

1reaction
gaardiolorcommented, Dec 29, 2017

ok great! I think both problems are solved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I make a Javascript POST request with the KuCoin API?
I have some success with the Kucoin API and I can make signed REST GET requests but I cannot get my REST POST...
Read more >
Get 24/7 Customer Service from KuCoin Support Team
Looking for support on KuCoin? Get your problems solved quickly through the help center. Our customer service is available 24/7 all year round....
Read more >
KuCoin API Documentation: General
General. Introduction. Welcome to KuCoin's trader and developer documentation. These documents outline the exchange functionality, market details, and APIs.
Read more >
Deposit Did Not Arrive at KuCoin or Deposited to the Wrong ...
Made a deposit to KuCoin but it hasn't arrived? Don't worry. As long as the address was filled correctly and you remembered to...
Read more >
How to Make a Trade on KuCoin
The reason can vary. The order may have been canceled due to insufficient funds or exceeding the KuCoin Price Protection Limit. ▷ For...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found