KuCoin TypeScript SDK example: rest-spot-public.ts
KuCoin TypeScript SDK REST example for Kucoin/Rest/rest-spot-public.ts. Source code reference for exchange REST, WebSocket, and API integration patterns with links to matching Siebly SDK documentation.
Example Path
Kucoin/Rest/rest-spot-public.ts
Source Link
Repository source: https://github.com/sieblyio/crypto-api-examples/blob/master/examples/Kucoin/Rest/rest-spot-public.ts
Related SDK Docs
Example Source
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();