Skip to main content
Skip to main content

Bybit Data Connector

Want Bitcoin, Ethereum, or altcoin charts with live prices and no API key? The Bybit connector talks to Bybit public v5 endpoints — history over REST, candle updates over WebSocket.

Loading chart…

Use the controls above to change symbol and timeframe. This is the same integration you will copy into your app.

Standalone demo

Full-page version with sample code: Bybit live demo.

What you get

FeatureDetails
No API keyPublic Bybit spot market data
HistoryUp to 1,000 candles per request
Live ticksWebSocket kline stream, auto-reconnect + heartbeat
PairsMajor spot symbols (BTCUSDT, ETHUSDT, …)
Timeframes1m through monthly

Perfect for crypto dashboards, multi-exchange terminals, and prototypes.

Install

npm install @efixdata/exeria-chart @efixdata/connector-bybit

Minimal example

import { createChart } from "@efixdata/exeria-chart";
import { BybitAdapter } from "@efixdata/connector-bybit";

const connector = new BybitAdapter();

const chart = createChart({
container,
dataAdapter: connector,
});

chart.init();

await chart.loadData("BTCUSDT", {
interval: "1d",
limit: 1000,
});

chart.subscribeToUpdates("BTCUSDT", (tick) => {
console.log("Last price:", tick.price ?? tick.c);
});

Step by step

1 — Create the connector

const connector = new BybitAdapter();

Uses Bybit public URLs by default (category: "spot"). Optional tuning below.

2 — Attach to the chart

const chart = createChart({ container, dataAdapter: connector });
chart.init();

The chart delegates loadData and subscribeToUpdates to the connector.

3 — Load history

await chart.loadData("BTCUSDT", {
interval: "1h",
limit: 500,
});
OptionMeaning
intervalCandle size — "1m", "1h", "1d", "1w", "1M"
limitHow many recent bars (max 1,000)
from / toOptional date range instead of “latest N”

4 — Go live

chart.subscribeToUpdates("BTCUSDT");
// or with a callback:
chart.subscribeToUpdates("BTCUSDT", (tick) => { /* update UI */ });

5 — Clean up

chart.unsubscribeFromUpdates();
await connector.disconnect();
SymbolMarket
BTCUSDTBitcoin / USDT
ETHUSDTEthereum / USDT
BNBUSDTBNB / USDT
SOLUSDTSolana / USDT
XRPUSDTXRP / USDT

Symbol format is BASE + QUOTE with no separator (BTCUSDT, not BTC-USDT).

Switch cryptocurrency

async function switchSymbol(newSymbol: string) {
chart.unsubscribeFromUpdates();

await chart.loadData(newSymbol, {
interval: "1d",
limit: 500,
});

chart.subscribeToUpdates(newSymbol);
}

Always unsubscribe before loading a new symbol on the same chart instance.

Custom configuration (optional)

Defaults work for most apps. For retries, testnet, or alternate hosts:

const connector = new BybitAdapter({
baseUrl: "https://api.bybit.com",
wsUrl: "wss://stream.bybit.com/v5/public/spot",
category: "spot",
requestTimeout: 10000,
maxRetries: 5,
retryDelay: 2000,
pingIntervalMs: 20000,
});

For testnet:

const connector = new BybitAdapter({
baseUrl: "https://api-testnet.bybit.com",
wsUrl: "wss://stream-testnet.bybit.com/v5/public/spot",
});

Error handling

try {
await chart.loadData("BTCUSDT", { interval: "1d", limit: 1000 });
} catch (error) {
if (error instanceof Error && error.message.includes("Invalid symbol")) {
console.error("Symbol not found on Bybit");
} else {
console.error("Load failed:", error);
}
}

Show a retry button or message in your UI — users on bad networks will thank you.

Limits to know

TopicLimit
Candles per request1,000 max
REST ratePublic IP rate limits (see Bybit docs)
WebSocketHeartbeat ping every 20 seconds recommended
BrowserNeeds WebSocket support (all modern browsers)

For heavy traffic: cache history server-side.

Binance vs Bybit

BinanceBybit
Symbol formatBTCUSDTBTCUSDT
API key for public dataNoNo
Best forLargest spot liquidityMulti-exchange apps, Bybit-native users

Need Binance, OKX, Kraken, or KuCoin instead? See Binance, OKX, Kraken, or KuCoin.

What is next?