Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/binance/llms.txt

Use this file to discover all available pages before exploring further.

The Binance Node.js SDK (binance on npm) gives you a complete, production-ready interface to Binance’s REST APIs and WebSockets. It covers every major product group — Spot, Margin, Wallet, USD-M Futures, COIN-M Futures, Portfolio Margin, and more — with dedicated clients for each, full TypeScript type definitions, and smart WebSocket connection management built in.

Quickstart

Install the SDK and make your first REST API call in minutes

Authentication

Set up HMAC, RSA, or Ed25519 API key authentication

REST Clients

Explore MainClient, USDMClient, CoinMClient, and PortfolioClient

WebSockets

Stream real-time market data with automatic reconnection

Choose Your Client

The SDK is organized around Binance’s product groups. Each REST client maps directly to a separate Binance API surface:

MainClient

Spot trading, Margin, Wallet, Convert, Earn, Sub-accounts, and more

USDMClient

USD-M Futures — perpetual and delivery contracts settled in USDT

CoinMClient

COIN-M Futures — contracts settled in the underlying cryptocurrency

PortfolioClient

Portfolio Margin — unified margin across Spot, UM, and CM Futures

WebSocket Clients

WebsocketClient

Subscribe to market data and user data streams across all product groups

WebsocketAPIClient

Use the Binance WebSocket API with a REST-like async/await interface

Key Features

Full TypeScript Support

Strongly typed request and response objects for every endpoint across all clients

All Auth Mechanisms

HMAC, RSA, and Ed25519 — the SDK auto-detects key type from your secret

Smart WebSocket Persistence

Automatic heartbeats, reconnection, and listenKey lifecycle management

Response Beautification

Opt-in conversion of single-letter keys to descriptive names and number strings to numbers

Demo Trading & Testnet

Switch environments with a single constructor option — no URL changes needed

Browser Support

Pre-built webpack bundle in dist/ for frontend and browser environments

Getting Help

GitHub Issues

Report bugs or request features on GitHub

Node.js Algo Traders

Community discussion on Telegram for Node.js traders

Build docs developers (and LLMs) love