BitMart TypeScript SDK example: spot-get-klines.ts

BitMart TypeScript SDK REST Spot example for Bitmart/Rest/Spot/spot-get-klines.ts. Source code reference for exchange REST, WebSocket, and API integration patterns with links to matching Siebly SDK documentation.

Example Path

Bitmart/Rest/Spot/spot-get-klines.ts

Source Link

Repository source: https://github.com/sieblyio/crypto-api-examples/blob/master/examples/Bitmart/Rest/Spot/spot-get-klines.ts

Related SDK Docs

Example Source

import { RestClient } from 'bitmart-api';

const client = new RestClient();

async function getKlines() {
  try {
    const klines = await client.getSpotLatestKlineV3({ symbol: 'BTC_USDT' });

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

getKlines();