---
title: "KuCoin REST Spot Public JavaScript SDK Example | Siebly"
description: "KuCoin REST spot public 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-public"
robots: "index,follow"
---

# KuCoin REST Spot Public JavaScript SDK Example

KuCoin REST spot public 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-public.ts](/examples/Kucoin/Rest/rest-spot-public)

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

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

## rest-spot-public.ts

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

async function start() {
  const client = new SpotClient();

  try {
    // Fetch all symbols
    const symbols = await client.getSymbols();
    console.log('symbols:', JSON.stringify(symbols, null, 2));

    // Fetch ticker for a specific symbol
    const ticker = await client.getTicker({ symbol: 'BTC-USDT' });
    console.log('ticker:', JSON.stringify(ticker, null, 2));

    // Fetch klines for a specific symbol
    const klines = await client.getKlines({
      symbol: 'BTC-USDT',
      type: '1day',
    });
    console.log(klines);
  } catch (e) {
    console.error('Req error: ', e);
  }
}

start();
```
