Getting Started

This API has been updated to work with the v2 Sandbox

Installation

python-kucoin is available on PYPI. Install with pip:

pip install python-kucoin

For previous v1 API install with

pip install python-kucoin==0.1.12

Register on Kucoin

Firstly register an account with Kucoin.

To test on the Sandbox register with Kucoin Sandbox.

Generate an API Key

To use signed account methods you are required to create an API Key and enable it.

Initialise the client

Pass your API Key, Secret and API Passphrase

from kucoin.client import Client
client = Client(api_key, api_secret, api_passphrase)

Requests Settings

python-kucoin uses the requests library.

You can set custom requests parameters for all API calls when creating the client.

client = Client("api-key", "api-secret", "api-passphrase", {"verify": False, "timeout": 20})

Check out the requests documentation for all options.

Proxy Settings

You can use the Requests Settings method above

proxies = {
    'http': 'http://10.10.1.10:3128',
    'https': 'http://10.10.1.10:1080'
}

# in the Client instantiation
client = Client("api-key", "api-secret", {'proxies': proxies})

Or set an environment variable for your proxy if required to work across all requests.

An example for Linux environments from the requests Proxies documentation is as follows.

$ export HTTP_PROXY="http://10.10.1.10:3128"
$ export HTTPS_PROXY="http://10.10.1.10:1080"

For Windows environments

C:\>set HTTP_PROXY=http://10.10.1.10:3128
C:\>set HTTPS_PROXY=http://10.10.1.10:1080

API Rate Limit

Public Endpoints - 30 requests per ten seconds.

Private Endpoints - 50 requests per ten seconds.

  • Websocket *

Connect - 30 times per minutes

Subscribe - 120 times per minute

Unsubscribe - 120 times per minute