---
title: "KuCoin REST Spot Private Trade Example | Siebly"
description: "KuCoin REST spot private trade JavaScript example for the Siebly KuCoin SDK, covering exchange REST API and WebSocket integration, setup, and production SDK docs."
canonical: "https://siebly.io/examples/Kucoin/Rest/rest-spot-private-trade"
robots: "index,follow"
---

# KuCoin REST Spot Private Trade Example

KuCoin REST spot private trade JavaScript example for the Siebly KuCoin SDK, covering exchange REST API and WebSocket integration, setup, and production SDK docs.

**Path:** [Home](/) / [Examples](/examples) / [Kucoin](/examples/Kucoin) / [Rest](/examples/Kucoin/Rest) / [rest-spot-private-trade.ts](/examples/Kucoin/Rest/rest-spot-private-trade)

[View source on GitHub](https://github.com/sieblyio/crypto-api-examples/blob/master/examples/Kucoin/Rest/rest-spot-private-trade.ts)

[Open the KuCoin JavaScript SDK guide](/sdk/kucoin/javascript)

## rest-spot-private-trade.ts

```typescript
import { SpotClient } from 'kucoin-api';

async function start() {
  const account = {
    key: 'keyHere',
    secret: 'secretHere',
    passphrase: 'memoHere',
  };

  const client = new SpotClient({
    apiKey: account.key,
    apiSecret: account.secret,
    apiPassphrase: account.passphrase,
  });

  try {
    const spotBuyResult = await client.submitHFOrder({
      clientOid: client.generateNewOrderID(),
      side: 'buy',
      type: 'market',
      symbol: 'BTC-USDT',
      size: '0.00001',
    });
    console.log('spotBuy ', JSON.stringify(spotBuyResult, null, 2));

    const spotSellResult = await client.submitHFOrder({
      clientOid: client.generateNewOrderID(),
      side: 'sell',
      type: 'market',
      symbol: 'BTC-USDT',
      size: '0.00001',
    });

    console.log('spotSellResult ', JSON.stringify(spotSellResult, null, 2));
  } catch (e) {
    console.error('Req error: ', e);
  }
}

start();
```
