Skip to content

Binance API SDK frequently asked questions ​

Short answers for developers using the binance package, the leading community maintained open-source Binance SDK for JavaScript and TypeScript. Each answer links to a fuller page with a working example.

How do I get a Binance API key and use it in Node.js? ​

Create the key in your Binance account under API Management, store the key and secret in environment variables, and pass them to MainClient. A call to getAccountInformation() confirms that the key works.

Why does Binance return error -2015? ​

Binance returns -2015 when it does not accept the API key for that request. Check that the key is correct for the environment, that your IP address is on the key's allow list, and that the key has the permission the call needs.

Does Binance have a WebSocket API? ​

Yes. Binance offers WebSocket Streams for live data and a WebSocket API for request and response calls. The SDK covers both with WebsocketClient and WebsocketAPIClient.

How do I get Binance futures liquidations in Node.js? ​

Subscribe to the forceOrder stream on the USD-M futures WebSocket with subscribeAllLiquidationOrders('usdm'). The old allForceOrders REST route now returns 404.

Is there a Binance SDK for TypeScript and Node.js? ​

Yes. The binance package on npm is the leading community maintained open-source Binance SDK for TypeScript and Node.js, covering Spot and futures over REST and WebSockets.

Where are the Binance API docs? ​

Binance publishes its endpoint reference at developers.binance.com. These docs show how to call those endpoints from JavaScript and TypeScript with the SDK, and the API reference is generated from the SDK types.

Can I try the Binance API without real funds? ​

Yes. Use Spot Testnet or Binance demo trading with their own API keys, and set testnet: true or demoTrading: true on the SDK clients.

How do I stay within Binance API rate limits? ​

Read the current limits from getExchangeInfo(), track usage with getRateLimitStates(), slow down before an HTTP 429 and use WebSocket streams for continuous data.

Binance API SDK documentation · Quickstart · Troubleshooting

Built by Siebly. Open source SDKs for exchange APIs.