Skip to main content
Skip to main content

Kraken Data Connector

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

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: Kraken live demo.

What you get

FeatureDetails
No API keyPublic Kraken Spot market data
HistoryUp to 720 candles per REST request
Live ticksWebSocket v2 ohlc channel with heartbeat
PairsUSD spot symbols (BTC/USD, ETH/USD, …)
Symbol helperAccepts BTCUSD, XBTUSD, and BTC/USD
Timeframes1m through weekly (1M maps to Kraken 21600-minute bars)

Perfect for crypto dashboards, USD-denominated portfolios, and Kraken-native trading apps. For Node.js multi-exchange backends, see CCXT.

Install

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

Minimal example

import { createChart } from "@efixdata/exeria-chart";
import { KrakenAdapter } from "@efixdata/connector-kraken";

const connector = new KrakenAdapter({ pageDelayMs: 1000 });

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

chart.init();

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

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

Step by step

1 — Create the connector

const connector = new KrakenAdapter({ pageDelayMs: 1000 });

Uses Kraken 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("BTC/USD", {
interval: "1h",
limit: 500,
});
OptionMeaning
intervalCandle size — "1m", "1h", "1d", "1w", "1M"
limitHow many recent bars (up to 720 per REST page)
from / toOptional date range filter after fetch

4 — Go live

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

5 — Clean up

chart.unsubscribeFromUpdates();
await connector.disconnect();
SymbolMarket
BTC/USDBitcoin / USD
ETH/USDEthereum / USD
SOL/USDSolana / USD
ADA/USDCardano / USD
XRP/USDXRP / USD

Kraken WebSocket v2 uses BTC/USD (not XBT/USD). The adapter maps compact forms like BTCUSD and XBTUSD automatically.

Kraken symbols vs other exchanges

Binance / BybitOKXKraken (WS v2)
BTCUSDTBTC-USDTBTC/USD
USDT quoteUSDT quoteUSD fiat quote
REST + WSREST + WSREST + WS v2

Switch pair

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)

const connector = new KrakenAdapter({
baseUrl: "https://api.kraken.com",
wsUrl: "wss://ws.kraken.com/v2",
requestTimeout: 10000,
maxRetries: 5,
retryDelay: 2000,
pageDelayMs: 1000,
heartbeatDeadlineMs: 5000,
});

Error handling

try {
await chart.loadData("BTC/USD", { interval: "1d", limit: 500 });
} catch (error) {
if (error instanceof Error && error.message.includes("Unknown asset pair")) {
console.error("Symbol not found on Kraken");
} 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 REST request720 max
REST OHLC rate~1 request/second per IP and pair
WebSocketv2 only — wss://ws.kraken.com/v2
IntervalsNo native 2h, 3m, 6h, or 12h
1MMaps to 21600-minute bars (~15 days), not calendar month

For heavy traffic: cache history server-side and keep pageDelayMs at 1000 or higher.

Kraken vs CCXT

Dedicated Kraken connectorCCXT connector
RuntimeBrowser + Node.jsNode.js only
SymbolBTC/USDexchangeId: "kraken"
LiveWebSocket v2 OHLCPolling via CCXT

Need Kraken in the browser? Use this connector. Need 100+ exchanges on your backend? Use CCXT.

What is next?