Skip to main content
Skip to main content

Gate.io Data Connector

Building for Gate.io spot markets? The Gate connector talks to the public API v4 — history over REST, live candles over WebSocket. No API key required.

Loading chart…

Use the controls above to change currency pair and timeframe. This docs demo routes requests through /api/gate because Gate.io REST does not allow browser cross-origin requests.

Browser vs server

In your app, use GateAdapter directly from Node.js or your backend — no proxy required. The docs proxy exists only so live demos work without CORS errors.

Standalone demo

Full-page version with sample code: Gate.io live demo.

What you get

FeatureDetails
No API keyPublic Gate.io spot market data
HistoryOHLCV via /spot/candlesticks (paginated, 1000 per request)
Live ticksWebSocket spot.candlesticks channel
PairsBTC_USDT, ETH_USDT, and other Gate currency pairs
Symbol helperAccepts BTCUSDT, BTC-USDT, bare BTCBTC_USDT
Timeframes1m through 1d, plus 1w mapped to Gate 7d

Perfect for Gate-native trading UIs and browser-first crypto dashboards. For Node.js multi-exchange backends, see CCXT.

Gate.io vs CCXT

Gate.io connectorCCXT
RuntimeBrowser + NodeNode only
API keyNo (public data)No (public data)
Symbol formatBTC_USDTexchangeId: "gate"
Live WSNative Gate v4 candlesticksREST-only in adapter-ccxt
Best forFrontend Gate.io chartsMany exchanges on your server

Install

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

Minimal example

import { createChart } from "@efixdata/exeria-chart";
import { GateAdapter } from "@efixdata/connector-gate";

const connector = new GateAdapter({ pageDelayMs: 300 });

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

chart.init();

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

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

Step by step

1 — Create the connector

const connector = new GateAdapter({ pageDelayMs: 300 });

Uses Gate public URLs by default. Optional tuning below.

2 — Attach to the chart

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

3 — Load history

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

4 — Subscribe to live updates

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

Call subscribeToUpdates after loadData succeeds.

Configuration

const connector = new GateAdapter({
baseUrl: "https://api.gateio.ws/api/v4",
wsUrl: "wss://api.gateio.ws/ws/v4/",
requestTimeout: 10000,
maxRetries: 3,
retryDelay: 1000,
pageDelayMs: 300,
pollingIntervalMs: 5000,
useWebSocket: true,
});

Set useWebSocket: false to poll REST /spot/tickers instead of WebSocket.

Docs demo proxy

Gate.io REST does not send Access-Control-Allow-Origin for browser origins, so direct fetch from localhost fails with Failed to fetch. The docs dev server exposes /api/gate/ohlcv and /api/gate/ticker through apiProxyPlugin.js. In production, run GateAdapter on your server or use WebSocket from a backend relay.

Supported symbols

You passGate currency_pair
BTC_USDTBTC_USDT
BTC-USDTBTC_USDT
BTCUSDTBTC_USDT
BTCBTC_USDT

Supported timeframes

1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w (mapped to Gate 7d)

Unsupported natively: 3m, 2h, 6h, 8h, 12h, 1M — the adapter throws a clear error.

Gate limits history to roughly 10,000 candles back per request window.