Example: rest-futures-public.ts

Static snapshot for Kucoin/Rest/rest-futures-public.ts.

Example Path

Kucoin/Rest/rest-futures-public.ts

Source Link

Repository source: https://github.com/sieblyio/crypto-api-examples/blob/master/examples/Kucoin/Rest/rest-futures-public.ts

Code Snapshot

import { FuturesClient } from 'kucoin-api';

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

  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: 'XBTUSDM' });
    console.log('ticker:', JSON.stringify(ticker, null, 2));

    // Fetch klines for a specific symbol
    const klines = await client.getKlines({
      symbol: 'XBTUSDM',
      granularity: 60,
    });
    console.log('klines:', JSON.stringify(klines, null, 2));
  } catch (e) {
    console.error('Req error: ', e);
  }
}

start();

This is a static, crawlable snapshot. The interactive app loads after JavaScript starts and can refresh live data.