Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/kucoin-api/llms.txt

Use this file to discover all available pages before exploring further.

KuCoin operates separate platform instances for different regions. The kucoin-api SDK supports all three with a single apiRegion option that automatically selects the correct base URL, injects any required extra headers, and warns you when a feature (such as futures trading) is unavailable in your region. If you need even finer control, you can override the base URL entirely with the baseUrl option.

Supported Regions

The apiRegion option accepts one of three string values:
ValuePlatformBase URLNotes
'global'kucoin.comhttps://api.kucoin.comDefault — used when apiRegion is omitted
'EU'kucoin.euhttps://api.kucoin.euNo futures trading at this time
'AU'kucoin.com/auhttps://api.kucoin.comAdds X-SITE-TYPE: australia header automatically
The 'AU' region shares the same API domain as 'global' but sends an extra X-SITE-TYPE: australia header on every request. This ensures market data calls return AU-specific trading pairs, tickers, and other localised data.

Using apiRegion with REST Clients

Pass apiRegion in the options object when constructing any REST client (SpotClient, FuturesClient, BrokerClient, or UnifiedAPIClient):
import { SpotClient } from 'kucoin-api';

const client = new SpotClient({
  apiKey: 'apiKeyHere',
  apiSecret: 'apiSecretHere',
  apiPassphrase: 'apiPassPhraseHere',
  // apiRegion: 'global', // This is the default — same as omitting the option
});

try {
  const accountSummary = await client.getAccountSummary();
  console.log('accountSummary ', JSON.stringify(accountSummary, null, 2));
} catch (e) {
  console.error('Req error: ', e);
}

KuCoin EU Limitations

KuCoin EU does not currently support the Futures market. If you instantiate a FuturesClient with apiRegion: 'EU', the SDK will emit a console warning and API requests may not behave as expected:
Futures market is not available for EU users at this time. API requests may not function as expected
Do not use FuturesClient with apiRegion: 'EU'. The SDK logs a warning but does not throw — requests will be sent to the global futures endpoint, which will reject your EU credentials.

KuCoin AU Specifics

When apiRegion is set to 'AU', the SDK injects the X-SITE-TYPE: australia header into every HTTP request automatically. You do not need to set this header yourself. This header ensures that:
  • Market data endpoints return AU-specific trading pairs
  • Ticker prices and order book data reflect the AU market
  • Account operations are routed to the AU product context
// The SDK internally adds this header for you when apiRegion: 'AU' is set:
// 'X-SITE-TYPE': 'australia'

import { SpotClient } from 'kucoin-api';

const auClient = new SpotClient({
  apiKey: process.env.API_KEY!,
  apiSecret: process.env.API_SECRET!,
  apiPassphrase: process.env.API_PASSPHRASE!,
  apiRegion: 'AU',
});

Using apiRegion with WebsocketClient

The apiRegion option is also accepted by WebsocketClient and WebsocketAPIClient, ensuring WebSocket connections and their authentication flow use the correct regional credentials:
import { WebsocketClient } from 'kucoin-api';

const wsClient = new WebsocketClient({
  apiKey: 'apiKeyHere',
  apiSecret: 'apiSecretHere',
  apiPassphrase: 'apiPassPhraseHere',
  apiRegion: 'EU', // for KuCoin EU
  // apiRegion: 'global', // for KuCoin.com (default)
  // apiRegion: 'AU',     // for KuCoin AU
});

wsClient.on('open', (data) => {
  console.log('open: ', data?.wsKey);
});

wsClient.on('update', (data) => {
  console.info('data received: ', JSON.stringify(data));
});

wsClient.on('exception', (data) => {
  console.error('exception: ', {
    msg: data.msg,
    errno: data.errno,
    code: data.code,
    syscall: data.syscall,
    hostname: data.hostname,
  });
});

wsClient.subscribe('/market/ticker:BTC-USDT', 'spotPublicV1');

Overriding the Base URL Manually

If you need to point the SDK at a custom domain — for example, a corporate proxy, a staging environment, or a future regional endpoint not yet built into the SDK — use the baseUrl option. This takes precedence over apiRegion:
import { SpotClient } from 'kucoin-api';

const client = new SpotClient({
  apiKey: 'apiKeyHere',
  apiSecret: 'apiSecretHere',
  apiPassphrase: 'apiPassPhraseHere',
  // Overrides any URL that apiRegion would have selected:
  baseUrl: 'https://api.kucoin.com',
});
Use baseUrl when you want to route traffic through a proxy that sits in front of the KuCoin API. The SDK will send all requests to your specified URL while still handling authentication headers correctly.

Region URL Reference

The SDK’s internal URL map (from src/lib/requestUtils.ts) resolves each client type and region to a base URL at construction time:
const kucoinURLMap = {
  main:                  'https://api.kucoin.com',
  mainEU:                'https://api.kucoin.eu',
  futures:               'https://api-futures.kucoin.com',
  broker:                'https://api-broker.kucoin.com',
  unifiedTradingAccount: 'https://api.kucoin.com',
};
The apiRegion: 'EU' flag causes Spot and Unified clients to resolve to mainEU (https://api.kucoin.eu), while Futures and Broker clients remain on their standard global domains.

Build docs developers (and LLMs) love