---
title: "BitMart REST Spot Get Klines JavaScript SDK Example | Siebly"
description: "BitMart REST spot get klines JavaScript example for the Siebly BitMart SDK, covering exchange REST API and WebSocket integration, setup, and production SDK docs."
canonical: "https://siebly.io/examples/Bitmart/Rest/Spot/spot-get-klines"
robots: "index,follow"
---

# BitMart REST Spot Get Klines JavaScript SDK Example

BitMart REST spot get klines JavaScript example for the Siebly BitMart SDK, covering exchange REST API and WebSocket integration, setup, and production SDK docs.

**Path:** [Home](/) / [Examples](/examples) / [Bitmart](/examples/Bitmart) / [Rest](/examples/Bitmart/Rest) / [Spot](/examples/Bitmart/Rest/Spot) / [spot-get-klines.ts](/examples/Bitmart/Rest/Spot/spot-get-klines)

[View source on GitHub](https://github.com/sieblyio/crypto-api-examples/blob/master/examples/Bitmart/Rest/Spot/spot-get-klines.ts)

[Open the BitMart JavaScript SDK guide](/sdk/bitmart/javascript)

## spot-get-klines.ts

```typescript
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();
```
