Skip to main content
Skip to main content

Binance Data Connector

Want Bitcoin, Ethereum, or altcoin charts with live prices and no API key? The Binance connector talks to Binance public endpoints — history over REST, 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: Binance live demo.

What you get

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

Perfect for crypto dashboards, DEX frontends, and prototypes.

Install

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

Minimal example

import { createChart } from "@efixdata/exeria-chart";
import { BinanceAdapter } from "@efixdata/connector-binance";

const connector = new BinanceAdapter();

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 BinanceAdapter();

Uses Binance public URLs by default. 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 always 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 or alternate REST host:

const connector = new BinanceAdapter({
baseUrl: "https://data-api.binance.vision",
requestTimeout: 10000,
maxRetries: 5,
retryDelay: 2000,
});

Error handling

try {
await chart.loadData("BTCUSDT", { interval: "1d", limit: 1000 });
} catch (error) {
if (error instanceof Error && error.message.includes("404")) {
console.error("Symbol not found on Binance");
} 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 rate~1,200 requests/minute (Binance policy)
BrowserNeeds WebSocket support (all modern browsers)

For heavy traffic: cache history server-side or use Binance's data API mirror.

What is next?

  • Bybit — same connector pattern on Bybit spot data
  • OKX — OKX spot with BTC-USDT symbols
  • Kraken — USD spot with BTC/USD symbols
  • KuCoin — USDT spot with BTC-USDT symbols
  • Coinbase — USD / USDC spot with BTC-USD product ids
  • CoinGecko — broad catalog via coin ids (bitcoin, ethereum)
  • Overview — lifecycle and custom connectors
  • Loading data — all loadData options
  • Live data stream — what happens under the hood
  • Crypto terminal demo — full product example