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.
RestClientV5 is the primary class in the bybit-api Node.js SDK. It consolidates every Bybit V5 REST API endpoint — spanning public market data, authenticated order management, position control, account configuration, and asset transfers — into a single TypeScript class with full type safety and automatic request signing.
What RestClientV5 Covers
Every V5 REST group is available through one unified client instance:| Group | Description | Auth Required |
|---|---|---|
| Market Data | Klines, orderbooks, tickers, funding rates, open interest | No |
| Trading | Submit, amend, cancel, and batch orders | Yes |
| Spread Trading | Spread instruments, submit/amend/cancel spread orders | Yes |
| Positions | Leverage, margin mode, TP/SL, PnL | Yes |
| Account | Balances, fee rates, transaction logs, MMP | Yes |
| Asset | Transfers, deposits, withdrawals, coin info | Yes |
Constructor Options
Your Bybit API key. Required for all authenticated endpoints.
Your Bybit API secret. Required for all authenticated endpoints.
Connect to the Bybit testnet (
https://api-testnet.bybit.com) instead of the live environment.Use Bybit demo trading — a paper trading environment with real market data but no real funds.
Override the API region. Accepted values:
'default', 'bytick', 'NL', 'TK', 'KZ', 'HK', 'GE', 'UAE', 'EU'. Omit to use the default global endpoint.Override the maximum request window size in milliseconds. Defaults to Bybit’s standard
5000 ms. Increase if you experience clock-drift errors.When
true, per-endpoint rate limit headers are parsed and included in every response object.When
true, the SDK automatically throws an Error for any response where retCode !== 0, so you can use try/catch without manually checking the code.Instantiation
Response Structure
Every method inRestClientV5 returns a Promise<APIResponseV3WithTime<T>>. The shape of every response is consistent across all endpoints:
Error Handling
By default the SDK does not throw on API errors — it always resolves the
Promise. Check retCode to determine success or failure.Automatic exception throwing
Pagination with nextPageCursor
Endpoints that return lists support cursor-based pagination. The cursor for the next page is returned as result.nextPageCursor.
Rate Limits
The Bybit V5 API allows up to 400 requests per second on most endpoints. The SDK does not automatically throttle your requests — you are responsible for staying within limits.Explore by Category
Market Data
Fetch klines, orderbooks, tickers, funding rates, open interest, and more — all public, no API key required.
Trading
Submit, amend, cancel, and batch orders across spot, linear, inverse, and option categories.
Positions
Manage leverage, margin mode, TP/SL, risk limits, and closed PnL for your open positions.
Account
Query balances, fee rates, transaction logs, collateral settings, and MMP state.
Asset
Create transfers, manage deposits and withdrawals, and query coin information across accounts.
Authentication
Learn how to generate API keys and configure credentials for authenticated requests.