Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/bybit-api/llms.txt

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

The bybit-api SDK gives Node.js and browser developers a complete, production-ready interface to Bybit’s trading platform. It covers every V5 REST endpoint, all public and private WebSocket streams, and the WebSocket API for order management — with full TypeScript typings, automatic HMAC/RSA authentication, and resilient WebSocket reconnection built in.

Quickstart

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

Authentication

Generate API keys and configure HMAC or RSA authentication.

REST API

Explore the unified V5 REST client covering market data, trading, positions, account, and asset APIs.

WebSockets

Subscribe to real-time streams and send orders over WebSocket connections.

Why bybit-api?

Higher Rate Limits

All SDK users automatically receive 400 requests/second — higher than the highest VIP tier — with no configuration required.

Full TypeScript Support

Thorough request and response type declarations for every endpoint, including WebSocket events and WS API commands.

Auto Authentication

Pass your key and secret once. HMAC and RSA key types are automatically detected and handled for every signed request.

Smart WebSocket Persistence

Automatic heartbeats, silent disconnect detection, and reconnect-then-resubscribe — your subscriptions survive network interruptions.

WebSocket API

Submit, amend, and cancel orders over WebSocket using a promise-driven interface identical to the REST client.

Multi-Region Support

Route to the correct Bybit domain for EU, Turkey, Kazakhstan, HK, UAE, Georgia, and more with a single config option.

Getting Started

1

Install the package

npm install bybit-api
2

Create a REST client

import { RestClientV5 } from 'bybit-api';

const client = new RestClientV5({
  key: process.env.BYBIT_API_KEY,
  secret: process.env.BYBIT_API_SECRET,
});
3

Make your first call

const result = await client.getTickers({ category: 'linear', symbol: 'BTCUSDT' });
console.log(result.result.list);
4

Subscribe to a WebSocket stream

import { WebsocketClient } from 'bybit-api';

const ws = new WebsocketClient();
ws.subscribeV5('orderbook.50.BTCUSDT', 'linear');
ws.on('update', (data) => console.log(data));

Explore the Documentation

Market Data

Klines, orderbooks, tickers, funding rates, and open interest.

Trading

Place, amend, cancel, and batch orders across all categories.

Positions

Manage leverage, margin mode, TP/SL, and position history.

Public Streams

Real-time orderbook, kline, trade, and ticker data.

Private Streams

Live position, order, execution, and wallet updates.

WebSocket API

Send orders over WebSocket with async/await.

Build docs developers (and LLMs) love