---
title: "BitMart Spot Get Balances JavaScript SDK Example | Siebly"
description: "BitMart REST spot get balances 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-balances"
robots: "index,follow"
---

# BitMart Spot Get Balances JavaScript SDK Example

BitMart REST spot get balances 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-balances.ts](/examples/Bitmart/Rest/Spot/spot-get-balances)

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

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

## spot-get-balances.ts

```typescript
import { RestClient } from 'bitmart-api';

const account = {
  key: process.env.API_KEY || 'apiKeyHere',
  secret: process.env.API_SECRET || 'apiSecretHere',
  memo: process.env.API_MEMO || 'apiMemoHere',
};

const client = new RestClient({
  apiKey: account.key,
  apiSecret: account.secret,
  apiMemo: account.memo,
});

async function getSpotBalances() {
  try {
    const balances = await client.getAccountBalancesV1();

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

getSpotBalances();
```
