SDK guide
JavaScript
REST API + WebSocket

BitMart JavaScript SDK

Build with the BitMart REST API & WebSockets with our JavaScript SDK, TypeScript-first package declarations, and Node.js-compatible runtime patterns. Discover installation, common examples, a detailed endpoint-to-function map, and the REST API/WebSocket patterns shared across our Siebly SDK family.

Use the same TypeScript-first REST API and WebSocket clients from plain JavaScript or TypeScript in Node.js-compatible runtimes.

Package surfaces

Explore the following API capabilities are covered by our BitMart SDK:

  • Spot
  • Margin
  • Futures
  • WebSockets
  • WebSocket clients with:
    • Built-in heartbeats.
    • Automatic reconnection.
    • Automatic reauthentication and resubscribe where the exchange supports it.
  • Typed requests and responses for Node.js, JavaScript, and TypeScript IDEs.
  • Framework-neutral JavaScript snippets that stay approachable in Node.js-compatible runtimes.
  • TypeScript-first package declarations for stricter services, shared libraries, and editor-assisted integrations.

Install BitMart SDK

# Via your favourite package manager, e.g. npm:
npm install bitmart-api
# or pnpm:
pnpm install bitmart-api
# or yarn:
yarn add bitmart-api

Quickstart Examples with the BitMart JavaScript SDK

Get started with just a few lines of JavaScript. TypeScript, while not required, is absolutely recommended. TypeScript declarations are included with all our SDKs and provide convenient definitions on request & response fields, WebSocket payloads, and generally safer integrations.

Quickstart snippets are currently unavailable for this SDK and language combination.

Showing cached quickstart content from build-time configuration.

Endpoint Function Reference

BitMart JavaScript FAQ

What does the BitMart JavaScript SDK cover?

BitMart supports Spot, Margin, Futures, and WebSockets workflows. The JavaScript guide covers the main REST and WebSocket integration patterns.

How do I authenticate private BitMart API calls in JavaScript?

Install bitmart-api from npm & pass API credentials into the SDK client options, as shown in the BitMart JavaScript examples above. The SDK handles the exchange-specific signing requirements for private requests.

Does the BitMart JavaScript SDK help with WebSocket connection management?

Yes. Use the SDK WebSocket client for subscriptions, reconnect handling, and stream lifecycle management instead of building raw socket flows yourself.

Where should I start on the BitMart JavaScript page: REST or WebSocket?

Start with the REST quick start for installation, authentication, and request and response flows. Move to the WebSocket example when you need streaming market or account updates.

Direct Example Files

Open the example files below for JavaScript and TypeScript-compatible request, authentication, WebSocket, and Node.js service patterns.

Continue with implementation resources