Demo WebSocket API
Use the demo WebSocket endpoint to try live ticks and historical candles with the GoCharting Charting SDK. No API key or login is required.
Live demo
Chart wired to wss://gocharting.com/sdk/ws (ticks + history):
Endpoint
wss://gocharting.com/sdk/wsBrowser clients should connect from an allowed site origin (for example gocharting.com or localhost). Tools like Postman that omit the Origin header are also supported.
After connect
The server sends a text welcome frame:
Welcome-{connection-id}Keep the connection alive:
PINGServer reply:
PONGYou can also send PING-{token} and receive PONG-{token}.
Demo symbols
| Symbol | Description |
|---|---|
BYBIT:FUTURE:BTCUSDT | Bybit BTC/USDT perpetual |
BYBIT:FUTURE:ETHUSDT | Bybit ETH/USDT perpetual |
Other symbols are ignored (only allowlisted symbols appear in the ack).
Live trades are not sent until you SUBSCRIBE on that connection. UNSUBSCRIBE stops fan-out for that connection only — the demo server keeps the Bybit feeds warm in the backend regardless.
Live trades
Subscribe
{
"command": "SUBSCRIBE",
"channel": "trade",
"payload": ["BYBIT:FUTURE:BTCUSDT", "BYBIT:FUTURE:ETHUSDT"]
}Ack
{
"command": "SUBSCRIBE",
"channel": "trade",
"payload": ["BYBIT:FUTURE:BTCUSDT", "BYBIT:FUTURE:ETHUSDT"]
}Only supported symbols appear in the ack list.
Unsubscribe
{
"command": "UNSUBSCRIBE",
"channel": "trade",
"payload": ["BYBIT:FUTURE:BTCUSDT"]
}Trade stream (server to client)
{
"channel": "trade",
"payload": {
"BYBIT:FUTURE:BTCUSDT": [
{
"ltp": 67542.1,
"l_sz": 0.01,
"side": "Buy",
"t_ms": 1721040000123
}
]
}
}Fields may vary slightly by feed; treat unknown fields as optional.
Historical candles (timeseries)
All candle traffic is JSON text frames (not binary).
Request
{
"request_id": 1,
"command": "timeseries",
"payload": {
"symbol": "BYBIT:FUTURE:BTCUSDT",
"interval": "1m",
"session": "RTH",
"hint": "rows=200",
"echo": "chart-1"
}
}| Field | Required | Description |
|---|---|---|
symbol | yes | Example: BYBIT:FUTURE:BTCUSDT |
interval | yes | Example: 1m, 5m, 15m, 1h, 1D |
session | recommended | Example: RTH |
hint | no | Comma-separated options, example: rows=200 |
echo | no | Echoed back so you can correlate chart panes |
request_id | recommended | Echoed so you can match responses |
Not supported: seconds intervals (for example 1s, 10s).
Response (one or more chunks)
{
"command": "timeseries",
"request_id": 1,
"final": 1,
"echo": "chart-1",
"payload": {
"criteria": {
"symbol": "BYBIT:FUTURE:BTCUSDT",
"interval": "1m",
"session": "RTH"
},
"summary": {
"2026-07-15": 42
},
"bars": {
"2026-07-15": [
{
"date": "2026-07-15T10:00:00",
"open": 67000.0,
"high": 67120.5,
"low": 66980.0,
"close": 67055.2,
"volume": 123.45
}
]
}
}
}final | Meaning |
|---|---|
0 | More candle chunks will follow |
1 or 2 | Done for this request |
For daily (1D) bars, payload.bars may be a flat array instead of a date-to-bars map.
Errors
Most errors look like:
{
"command": "ERROR",
"request_id": 1,
"message": "Human-readable message."
}Candle errors may also include:
{
"command": "ERROR",
"request_id": 1,
"in": {},
"out": {
"message": "Symbol BYBIT:FUTURE:ETHUSDT is not supported.",
"dismissable": false,
"message_type": "UNSUPPORTED_SYMBOL"
}
}Common messages
| Situation | Message | message_type (if any) |
|---|---|---|
| Bad JSON | Invalid message. | — |
| Unknown command | Unsupported command. | — (plus command_in) |
| Bad subscribe payload | Invalid subscribe payload. | — |
| Unsupported symbol | Symbol … is not supported. | UNSUPPORTED_SYMBOL |
| Bad interval | Invalid interval. | INVALID_INTERVAL |
| Seconds interval | Seconds intervals are not supported. | UNSUPPORTED_INTERVAL |
| Empty history | No data found for …. | NO_DATA |
| Too many requests | Rate limit exceeded. Please try again later. | — (plus remaining) |
Connection-level limits return HTTP 429 before upgrade:
Too many requests. Please try again later.Quick start (browser)
const ws = new WebSocket("wss://gocharting.com/sdk/ws");
ws.onmessage = (ev) => {
if (typeof ev.data !== "string") return;
if (ev.data.startsWith("Welcome-") || ev.data.startsWith("PONG")) {
console.log(ev.data);
return;
}
const msg = JSON.parse(ev.data);
console.log(msg);
};
ws.onopen = () => {
ws.send("PING");
ws.send(
JSON.stringify({
request_id: 1,
command: "timeseries",
payload: {
symbol: "BYBIT:FUTURE:BTCUSDT",
interval: "1m",
session: "RTH",
hint: "rows=200",
echo: "demo-chart",
},
})
);
};
setInterval(() => {
if (ws.readyState === WebSocket.OPEN) ws.send("PING");
}, 20000);Integrator checklist
- Connect to
wss://gocharting.com/sdk/ws - Expect a
Welcome-frame, then sendPINGperiodically SUBSCRIBEthe symbols you need, then listen onchannel: "trade"- Fetch history with
command: "timeseries"and read chunks untilfinalis1or2 - Handle
command: "ERROR"as a first-class response path
Demo limits
Approximate per-IP guidance (subject to change):
- Up to about 5 concurrent connections
- Connection / message / candle request rate limits apply
- On limit: wait and retry (
Retry-Afteron HTTP 429, orremainingon WebSocket errors)