← All articles

KuCoin API 900001 “Trading pair does not exist” in Node.js: symbol formats, XBT futures and silent nulls

The KuCoin 900001 error (Trading pair BTCUSDT does not exist.) nearly always means the symbol is written in the wrong format rather than that the market is missing. KuCoin spot symbols are BASE-QUOTE with a hyphen, so BTC-USDT works while BTCUSDT, BTC_USDT and btc-usdt do not. Futures use a different scheme again, with XBT for bitcoin. Worse, some endpoints and every WebSocket topic don’t raise an error at all for a bad symbol. They just return nothing.

Use kucoin-api 2.6.10 to look up a spot pair or futures contract before submitting an order. Both lookups are public.

KuCoin 900001 symbol format check: BTC-USDT works, BTCUSDT, BTC_USDT and btc-usdt return 900001

KuCoin 900001 and related errors for each symbol format

Call Input Result
Spot getSymbol BTC-USDT Symbol details
Spot getSymbol BTCUSDT, BTC_USDT, btc-usdt 900001 Trading pair ... does not exist.
Spot getSymbol BTC/USDT HTTP 404 Not Found (the slash breaks the URL path)
Spot getTicker BTCUSDT code 200000 with data: null, no error
Futures getSymbol XBTUSDTM Contract details
Futures getSymbol BTCUSDTM, BTC-USDT 404000 The contract information you requested does not exist.
Futures getTicker BTCUSDTM 200003 Invalid symbol.
WebSocket /market/ticker: BTCUSDT Subscription acknowledged, then no data

Upper case matters on spot: btc-usdt failed with 900001 just like the compact form did.

Catching KuCoin 900001 from the SDK error

KuCoin returns most of these errors with HTTP status 200 and the real result in the JSON body. kucoin-api treats any body code other than 200000 as a failure and throws, with KuCoin’s body under body:

import { SpotClient } from 'kucoin-api';

const spot = new SpotClient();

try {
  await spot.getSymbol({ symbol: 'BTCUSDT' });
} catch (err) {
  const e = err as { code?: number; body?: { code?: string; msg?: string } };
  console.log(e.code, e.body?.code, e.body?.msg);
  // 200 900001 Trading pair BTCUSDT does not exist.
}

So branch on body.code, not on the HTTP status, which was 200 here.

The ticker that fails silently

getTicker is the call most bots hit first, and it does not throw for a bad symbol. KuCoin answers {"code":"200000","data":null}, so code that reads res.data.price crashes later with a TypeError that hides the real cause. Check for null explicitly:

const res = await spot.getTicker({ symbol: 'BTCUSDT' });
if (!res.data) {
  throw new Error('KuCoin returned no ticker for BTCUSDT: check the symbol format');
}
console.log(res.data.price);

Resolve spot symbols against the live list

Rather than inserting a hyphen by guessing where the quote currency starts, load the list once with getSymbols() and index every symbol under both its KuCoin form and its compact form. In the example output KuCoin listed 970 spot symbols and no two collapsed to the same compact string, so the lookup is unambiguous:

import { SpotClient } from 'kucoin-api';

const spot = new SpotClient();

type SpotIndex = Map<string, string>;

async function buildSpotIndex(): Promise<SpotIndex> {
  const { data } = await spot.getSymbols();
  const index: SpotIndex = new Map();
  for (const s of data) {
    index.set(s.symbol, s.symbol); // BTC-USDT
    index.set(s.symbol.replace('-', ''), s.symbol); // BTCUSDT
  }
  return index;
}

function resolveSpot(index: SpotIndex, input: string): string {
  const key = input.trim().toUpperCase().replace(/[_/:\s]/g, '-');
  const symbol = index.get(key) ?? index.get(key.replace('-', ''));
  if (!symbol) throw new Error(`KuCoin has no spot pair matching "${input}"`);
  return symbol;
}

const index = await buildSpotIndex();
resolveSpot(index, 'BTCUSDT'); // 'BTC-USDT'
resolveSpot(index, 'btc_usdt'); // 'BTC-USDT'
resolveSpot(index, 'BTC/USDT'); // 'BTC-USDT'
resolveSpot(index, 'ETHBTC'); // 'ETH-BTC'
resolveSpot(index, 'FOOUSDT'); // throws before any request is sent

Rebuild the index at start-up and every few hours, because new listings appear without notice.

A listed symbol can still be closed

A symbol that exists may not be tradable. Each entry from getSymbol and getSymbols carries enableTrading. On 25 November one spot symbol, VERITY-USDT, was listed with enableTrading: false. Check it before placing orders, along with baseMinSize, baseIncrement, priceIncrement and minFunds (for BTC-USDT: 0.00001, 0.00000001, 0.1 and 0.1):

async function assertSpotTradable(symbol: string): Promise<void> {
  const { data } = await spot.getSymbol({ symbol });
  if (!data.enableTrading) {
    throw new Error(`${symbol} is listed but trading is disabled`);
  }
}

Futures: XBT, not BTC

KuCoin Futures names bitcoin contracts with XBT: the USDT-margined perpetual is XBTUSDTM, the USDC one is XBTUSDCM and the coin-margined one is XBTUSDM. Other coins use their usual ticker, as in ETHUSDTM. BTCUSDTM does not exist, and it fails with 404000 on getSymbol and 200003 on getTicker. Look the contract up from FuturesClient.getSymbols() instead of building the string:

import { FuturesClient } from 'kucoin-api';

const futures = new FuturesClient();

async function findPerp(base: string, quote = 'USDT'): Promise<string> {
  const wanted = base.toUpperCase() === 'BTC' ? 'XBT' : base.toUpperCase();
  const { data } = await futures.getSymbols();
  const perp = data.find(
    (c) =>
      c.type === 'FFWCSX' &&
      c.baseCurrency === wanted &&
      c.quoteCurrency === quote &&
      c.settleCurrency === quote,
  );
  if (!perp) throw new Error(`No ${base}/${quote} perpetual on KuCoin Futures`);
  return perp.symbol;
}

await findPerp('BTC'); // 'XBTUSDTM'
await findPerp('ETH'); // 'ETHUSDTM'
await findPerp('BTC', 'USDC'); // 'XBTUSDCM'

type: 'FFWCSX' marks perpetuals; dated contracts such as XBTMZ26 are FFICSX. Remember that futures order sizes are in lots: XBTUSDTM has a multiplier of 0.001, so one lot is 0.001 BTC.

WebSockets acknowledge bad symbols and stay quiet

KuCoin’s WebSocket does not reject an unknown symbol. Subscribing to /market/ticker:BTCUSDT got a normal ack, exactly like /market/ticker:BTC-USDT, but only the second topic ever produced updates. The same happened on futures with /contractMarket/tickerV2:BTCUSDTM. A simple watchdog catches it:

import { WebsocketClient } from 'kucoin-api';

const ws = new WebsocketClient();
const topics = ['/market/ticker:BTC-USDT', '/market/ticker:BTCUSDT'];
const seen = new Set<string>();

ws.on('update', (data) => {
  seen.add(data.topic);
});

ws.subscribe(topics, 'spotPublicV1');

setTimeout(() => {
  for (const topic of topics) {
    if (!seen.has(topic)) console.warn(`No data on ${topic} after 10 s: check the symbol`);
  }
}, 10_000);
// No data on /market/ticker:BTCUSDT after 10 s: check the symbol

Ten seconds is plenty for a liquid ticker. For quiet markets or slower channels, lengthen the window, or resolve symbols with the REST index above before you subscribe.

KuCoin 900001 checklist

  • Spot symbols are BASE-QUOTE in upper case with a hyphen, for example BTC-USDT.
  • 900001: the spot symbol string is wrong. Fix the format or resolve it from getSymbols().
  • getTicker returns data: null for an unknown spot symbol. Check for it.
  • Futures use XBT for bitcoin. 404000 or 200003 on futures usually means BTC was used.
  • Check enableTrading before placing orders.
  • WebSocket subscriptions to bad symbols are acknowledged but silent. Add a no-data watchdog.

Further reading

The KuCoin API JavaScript tutorial walks through public data, keys, spot and futures orders and WebSockets in Node.js, and the KuCoin SDK docs list every REST and WebSocket method. If an order with a valid symbol is rejected for funds, see KuCoin API 200004 Balance insufficient in Node.js. The SDK is open source under the MIT licence, from the same maintainers as the binance, bybit-api and okx-api packages, with over 4.5 million npm downloads across 10+ SDKs.