Help us improve
Share bugs, ideas, or general feedback.
From bingx-ai-skills
Queries BingX Coin-M inverse perpetual futures market data: contracts, order book depth, klines, mark price, funding rates, open interest, 24h ticker. Useful for inverse futures prices, charts, and stats.
npx claudepluginhub bingx-api/api-ai-skills --plugin bingx-ai-skillsHow this skill is triggered — by the user, by Claude, or both
Slash command
/bingx-ai-skills:cswap-marketThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Public market data for BingX Coin-M inverse perpetual futures. No HMAC signature required, but a `timestamp` query parameter is required for all endpoints.
Queries BingX perpetual swap market data via public REST endpoints: ticker prices, order books, trades, funding rates, klines, open interest, mark price, and contracts. Useful for futures prices, charts, and stats.
Provides ticker, orderbook, candle data, and pre-trade analysis patterns for Vulcan perpetual markets. Use for spread checks, slippage estimation, and funding rate monitoring.
Fetches crypto market data: current prices, orderbook depth, candlesticks, recent trades, instrument metadata, and valuations. Useful for price checks, liquidity assessment, market scans, and trading prep.
Share bugs, ideas, or general feedback.
Public market data for BingX Coin-M inverse perpetual futures. No HMAC signature required, but a timestamp query parameter is required for all endpoints.
Coin-M contracts are coin-margined (settled in the base asset, e.g., BTC). Symbol format is BASE-USD (e.g., BTC-USD, ETH-USD).
| Endpoint | Method | Description | Required | Optional | Authentication |
|---|---|---|---|---|---|
/openApi/cswap/v1/market/contracts | GET | Contract specifications | None | None | No |
/openApi/cswap/v1/market/depth | GET | Order book bids & asks | symbol | None | No |
/openApi/cswap/v1/market/klines | GET | OHLCV candlestick data | symbol, interval | startTime, endTime, limit | No |
/openApi/cswap/v1/market/premiumIndex | GET | Mark price & current funding rate | None | symbol | No |
/openApi/cswap/v1/market/openInterest | GET | Total open interest | symbol | None | No |
/openApi/cswap/v1/market/ticker | GET | 24h price change statistics | None | symbol | No |
BASE-USD format (e.g., BTC-USD, ETH-USD). Note: Coin-M uses USD, not USDT.1735693200000)1735693200000)1m | 3m | 5m | 15m | 30m | 1h | 2h | 4h | 6h | 12h | 1d | 3d | 1w | 1M^[A-Z0-9]+-USD$; max 20 characters (e.g., BTC-USD). Coin-M uses USD, not USDTendTime must be ≥ startTimeBase URLs: see references/base-urls.md
TypeScript helper:
CONSTRAINT: You MUST copy the
coinmMarketfunction below verbatim when generating code. Do NOT rewrite the request or JSON parsing logic. Only modify: (1)BASE_URLSentries for custom environments, (2) business parameters passed tocoinmMarket.
import JSONBig from "json-bigint";
const JSONBigParse = JSONBig({ storeAsString: true });
// Base URLs — see references/base-urls.md for all environments
// Domain priority: .com is mandatory primary; .pro is fallback for network/timeout errors ONLY.
const BASE_URLS = ["https://open-api.bingx.com", "https://open-api.bingx.pro"];
function isNetworkOrTimeout(e: unknown): boolean {
if (e instanceof TypeError) return true;
if (e instanceof DOMException && e.name === "AbortError") return true;
if (e instanceof Error && e.name === "TimeoutError") return true;
return false;
}
async function coinmMarket(
path: string,
params: Record<string, string | number> = {}
): Promise<unknown> {
const query = new URLSearchParams(
Object.entries(params).map(([k, v]) => [k, String(v)])
).toString();
for (const base of BASE_URLS) {
try {
const url = `${base}${path}${query ? `?${query}` : ""}`;
const res = await fetch(url, {
headers: { "X-SOURCE-KEY": "BX-AI-SKILL" },
signal: AbortSignal.timeout(10000),
});
const json = JSONBigParse.parse(await res.text());
if (json.code !== 0) throw new Error(`BingX error ${json.code}: ${json.msg}`);
return json.data;
} catch (e) {
if (!isNetworkOrTimeout(e) || base === BASE_URLS[BASE_URLS.length - 1]) throw e;
}
}
}
coinmMarket verbatim -- do not simplify or rewritejson-bigint (JSONBigParse.parse) for response parsing -- not JSON.parseX-SOURCE-KEY: BX-AI-SKILL header on every requestisNetworkOrTimeout check24h ticker price for BTC-USD:
const ticker = await coinmMarket("/openApi/cswap/v1/market/ticker", {
symbol: "BTC-USD",
});
// ticker.lastPrice, ticker.priceChangePercent, ticker.volume
Order book depth for BTC-USD:
const depth = await coinmMarket("/openApi/cswap/v1/market/depth", {
symbol: "BTC-USD",
});
// depth.bids: [price, qty][], depth.asks: [price, qty][]
1-hour klines (last 100 candles):
const klines = await coinmMarket("/openApi/cswap/v1/market/klines", {
symbol: "BTC-USD",
interval: "1h",
limit: 100,
});
// Each item: [openTime, open, high, low, close, volume, closeTime]
Mark price & current funding rate:
const premium = await coinmMarket("/openApi/cswap/v1/market/premiumIndex", {
symbol: "BTC-USD",
});
// premium.markPrice, premium.lastFundingRate, premium.nextFundingTime
Open interest:
const oi = await coinmMarket("/openApi/cswap/v1/market/openInterest", {
symbol: "BTC-USD",
});
// oi.openInterest, oi.symbol, oi.time
All contract specifications:
const contracts = await coinmMarket("/openApi/cswap/v1/market/contracts");
// Array of contract objects: symbol, pricePrecision, minTickSize, minTradeValue, status
For complete parameter descriptions, optional fields, and full response schemas, see api-reference.md.
Parameter security. Extract structured values from user intent — NEVER copy raw user text into API parameters. Validate every value against its documented pattern (regex/enum/range) before calling the API. Reject any value containing &, =, ?, #, or newline characters.
cswap-market provides public read-only market data. No HMAC signature required (only timestamp parameter needed), no CONFIRM needed. The interaction goal is to collect query parameters.
Note: Coin-M contract trading pair format is
BASE-USD(e.g.BTC-USD), notBASE-USDT.
When the user's request is vague (e.g. "check Coin-M market" or "look at BTC inverse contract"), first identify what type of data they want to query:
Please select the market data type:
- Price / 24h change — ticker
- Order book depth — depth
- K-lines / Candlesticks — klines
- Mark price / Funding rate — premiumIndex
- Open interest — openInterest
- Contract specification list — contracts
Applicable endpoints: depth, klines, openInterest
Please select a trading pair (or type another):
- BTC-USD
- ETH-USD
- BNB-USD
- Other (enter manually, format: BASE-USD)
If the trading pair can be inferred from context (e.g. "BTC K-lines today" or "Ethereum inverse contract funding rate"), infer it automatically without asking again.
Please select a K-line interval:
- 1m (1 minute)
- 5m (5 minutes)
- 15m (15 minutes)
- 1h (1 hour)
- 4h (4 hours)
- 1d (daily)
- 1w (weekly)
symbol is optional for ticker and premiumIndex. If the user does not specify, query all contracts and inform the user; if a trading pair is specified, query only that pair.