Skip to main content
Skip to main content

Connect with a Data Connector

Writing fetch + WebSocket + candle parsing yourself is tedious. Data Connectors are plug-ins that do that work for you. Connect one, pass a symbol, and the chart loads history plus live ticks.

What you are building

A Bitcoin (or Ethereum, BNB, …) chart that:

  1. Downloads recent history when the page opens.
  2. Keeps updating as new trades happen.

No API key needed for the public Binance connector.

See it working first

Loading chart…

Switch symbol and timeframe with the controls. This is the same integration you will wire in your app.

Step 1 — Install

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

Step 2 — Create chart with the connector

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

const connector = new BinanceAdapter();

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

chart.init();

The adapter is the middleman between Binance and your chart.

Step 3 — Load history

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

BTCUSDT is the trading pair. interval is the candle size. limit is how many bars to request.

Step 4 — Subscribe to live prices

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

You do not call appendTick manually — the connector feeds the chart for you.

When to use a connector vs your own API

SituationBest path
Public crypto from BinanceData Connector (this tutorial)
Your company's proprietary pricesChart with your data
Another exchange or asset classImplement DataAdapter — see Data Connectors overview

More connectors

  • Binance — full feature list
  • CoinGecko — aggregated crypto data via coin ids
  • Gate.io — USDT spot on Gate.io
  • Massive — US stocks, forex, and crypto
  • EODHD — global EOD + intraday via EODHD

What is next?