/bingx-ai-skills:bingx-spot-ws-marketfrom bingx-ai-skills
Subscribes to BingX spot WebSocket market data streams: real-time trades, order book depth, K-lines, 24h ticker, latest price, best bid/ask, incremental depth. Use for live spot price feeds or streaming order books.
Ships in bingx-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Real-time market data streams for BingX spot trading via WebSocket. No authentication required.
WebSocket Endpoint: wss://open-api-ws.bingx.com/market
| Channel | dataType Format | Description | Push Frequency |
|---|---|---|---|
| Trade | {symbol}@trade | Latest trade detail | Real-time |
| K-Line | {symbol}@kline_{interval} | OHLCV candlestick | On update |
| Depth | {symbol}@depth{level} | Limited order book depth | Every 300ms |
| 24h Ticker | {symbol}@ticker | 24-hour price change statistics | Every 1s |
| Last Price | {symbol}@lastPrice | Latest trade price | Real-time |
| Book Ticker | {symbol}@bookTicker | Best bid/ask price & qty | Real-time |
| Incremental Depth | {symbol}@incrDepth | Incremental + full depth (1000 levels) | Every 500ms |
BASE-USDT format (e.g., BTC-USDT, ETH-USDT, SOL-USDT)5 | 10 | 20 | 50 | 100 (default 20)1min | 3min | 5min | 15min | 30min | 1h | 2h | 4h | 6h | 8h | 12h | 1d | 3d | 1w | 1MNote: Spot kline intervals use
minsuffix (e.g.,1min) unlike swap which usesm(e.g.,1m).
^[A-Z0-9]+-[A-Z]+$; max 20 characters (e.g., BTC-USDT)5, 10, 20, 50, 100WebSocket Connection: see references/websocket.md for connection basics, GZIP decompression, and Ping/Pong heartbeat.
TypeScript helper:
CONSTRAINT: You MUST copy the
connectSpotWsMarketfunction below verbatim when generating code. Do NOT rewrite the WebSocket or decompression logic. Only modify: (1) subscription channels passed to the function.
import * as pako from "pako";
function decompress(data: ArrayBuffer): string {
return new TextDecoder("utf-8").decode(pako.ungzip(new Uint8Array(data)));
}
function connectSpotWsMarket(
channels: string[],
onMessage: (data: unknown) => void
): WebSocket {
const ws = new WebSocket("wss://open-api-ws.bingx.com/market");
ws.binaryType = "arraybuffer";
ws.onopen = () => {
for (const ch of channels) {
ws.send(JSON.stringify({
id: crypto.randomUUID(),
reqType: "sub",
dataType: ch,
}));
}
};
ws.onmessage = (event) => {
const text = decompress(event.data as ArrayBuffer);
if (text.includes("ping") || text === "Ping") {
ws.send("Pong");
return;
}
try {
onMessage(JSON.parse(text));
} catch {
onMessage(text);
}
};
ws.onerror = (err) => console.error("WS error:", err);
ws.onclose = (ev) => console.log("WS closed:", ev.code, ev.reason);
return ws;
}
connectSpotWsMarket and decompress verbatim -- do not simplify or rewritews.binaryType = "arraybuffer" for GZIP decompressionping detection)Subscribe to BTC-USDT real-time trades:
connectSpotWsMarket(["BTC-USDT@trade"], (data) => {
// data.data: array of trade records
});
Subscribe to 50-level depth:
connectSpotWsMarket(["BTC-USDT@depth50"], (data) => {
// data.bids, data.asks
});
Subscribe to 1-minute K-line:
connectSpotWsMarket(["BTC-USDT@kline_1min"], (data) => {
// data.data.K: kline object
});
Subscribe to multiple channels at once:
connectSpotWsMarket([
"BTC-USDT@ticker",
"BTC-USDT@lastPrice",
"ETH-USDT@bookTicker",
], (data) => {
// Handle different data types
});
For complete subscription parameters, response field descriptions, and full response schemas, see api-reference.md.
CRITICAL RULES (apply to ALL responses):
&, =, ?, #, or newline characters.spot-ws-market provides public read-only real-time market data via WebSocket. No authentication required, no CONFIRM needed.
When the user's request is vague (e.g. "subscribe to spot market" or "stream spot BTC data"), first identify what type of data they want:
Please select the market data stream type:
- Real-time trades — trade
- Order book depth (snapshot) — depth
- K-line / Candlestick updates — kline
- 24h price change statistics — ticker
- Latest trade price — lastPrice
- Best bid/ask (top of book) — bookTicker
- Incremental depth updates — incrDepth
Please select a trading pair (or type another):
- BTC-USDT
- ETH-USDT
- SOL-USDT
- BNB-USDT
- Other (enter manually, format: BASE-USDT)
Please select a K-line interval:
- 1min (1 minute) / 5min / 15min / 1h / 4h / 1d / 1w
Default level is 20. Only ask if user wants a specific level.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
29 skills in this plugin
/bingx-agentBingX Agent (affiliate/broker) management — query invited users, daily commission details, agent user information, API transaction commission, and partner information. Use when the user asks about BingX agent invited users, affiliate commissions, referral relationships, partner data, or broker commission reports./bingx-announcementQuery BingX official announcements by module type — latest announcements, promotions, product updates, maintenance notices, listing/delisting, funding rate, crypto scout. Use when the user asks about BingX announcements, notices, activities, or the announcement API./bingx-dynamic-sl-tpUse when the user asks to set, adjust, or optimize stop-loss and take-profit for BingX perpetual futures, including dynamic stop-loss, trailing take-profit, partial take-profit, ATR stop-loss, volatility stop-loss, break-even stop, and trailing stop. It calculates SL/TP based on ATR, volatility, and support/resistance through bingx-swap-market and bingx-swap-trade.npx claudepluginhub bingx-api/api-ai-skills --plugin bingx-ai-skillsOther plugins' skills for the same job