Install
openclaw skills install coinw-spot-skillCoinw Spot REST API skill: covers market data, order placement/cancellation, order queries, account balances, and asset transfers.
openclaw skills install coinw-spot-skillCoinw Spot REST API skill: covers market data, order placement/cancellation, order queries, account balances, and asset transfers.
CoinW private endpoints require api_key and a request signature (sign).
Signing note: Spot endpoints use Spot MD5 uppercase signing. Do not use Contract HMAC-SHA256 signing for Spot APIs.
export COINW_API_KEY="your_api_key"
export COINW_SECRET_KEY="your_secret_key"
api_key/secret_key (and an account name). The agent will mask secrets when showing them back and store them securely in OpenClaw's credential storage (not inside skill markdown files).| No. | name | Endpoint | Description | Method | Authentication | Input Parameters | Output Parameters | Detailed Doc URL |
|---|---|---|---|---|---|---|---|---|
| 1.1 | Get trading pair information | /api/v1/public?command=returnSymbol | Returns detailed information for all spot pairs, including min/max order price, quantity limits, and precision. | GET | Public | — | currencyPair, currencyBase, currencyQuote, maxBuyCount, minBuyCount, pricePrecision, countPrecision, minBuyAmount, maxBuyAmount, and 12 total fields | https://www.coinw.com/api-doc/spot-trading/market/get-trading-pair-information |
| 1.2 | Get 24h ticker summary for all pairs | /api/v1/public?command=returnTicker | Returns 24h summary metrics for all available pairs, including last price, best bid/ask, and volume. | GET | Public | — | id, last, lowestAsk, highestBid, percentChange, isFrozen, high24hr, low24hr, baseVolume | https://www.coinw.com/api-doc/spot-trading/market/get-24h-trade-summary-for-all-instruments |
| 1.4 | Get order book | /api/v1/public?command=returnOrderBook | Queries spot order book data for a specified pair. Supports 5-level or 20-level depth. | GET | Public | size, symbol | asks, quantity, price, bids, quantity, price, pair | https://www.coinw.com/api-doc/spot-trading/market/get-order-book |
| 1.5 | Get recent trades | /api/v1/public?command=returnTradeHistory | Queries recent trade records for a specified pair, including amount, price, total, time, side, and trade ID. | GET | Public | symbol | id, type, price, amount, total, time, pair | https://www.coinw.com/api-doc/spot-trading/market/get-recent-trades |
| 1.6 | Get K-line data | /api/v1/public?command=returnChartData | Queries K-line (candlestick) data for a specified pair, including OHLC and volume. | GET | Public | currencyPair, period | date, high, low, open, close, volume, pair | https://www.coinw.com/api-doc/spot-trading/market/get-k-line |
| 1.7 | Get 24h volume for hot pairs | /api/v1/public?command=return24hVolume | Returns 24h volume summary for popular pairs and market totals (such as BTC/ETH/USDT-related metrics). | GET | Public | — | data, totalETH, totalUSDT, totalBTC, ETH_USDT, ETH, USDT, LTC_CNYT, LTC, and 28 total fields | https://www.coinw.com/api-doc/spot-trading/market/get-24h-volume-for-popular-instruments |
| No. | name | Endpoint | Description | Method | Authentication | Input Parameters | Output Parameters | Detailed Doc URL |
|---|---|---|---|---|---|---|---|---|
| 2.1 | Place order | /api/v1/private?command=doTrade | Places a spot order by specifying order type, amount, price, and external order ID. | POST | Private | api_key, sign, symbol, type, amount, rate, isMarket, out_trade_no | orderNumber | https://www.coinw.com/api-doc/spot-trading/trade/place-order |
| 2.2 | Cancel order | /api/v1/private?command=cancelOrder | Cancels an unfilled spot order by order ID. | POST | Private | api_key, sign, orderNumber | clientOrderId | https://www.coinw.com/api-doc/spot-trading/trade/cancel-order |
| 2.3 | Cancel all orders | /api/v1/private?command=cancelAllOrder | Cancels all unfilled orders for a specified trading pair. | POST | Private | api_key, sign, currencyPair | msg | https://www.coinw.com/api-doc/spot-trading/trade/cancel-all-orders |
| No. | name | Endpoint | Description | Method | Authentication | Input Parameters | Output Parameters | Detailed Doc URL |
|---|---|---|---|---|---|---|---|---|
| 3.1 | Get open orders | /api/v1/private?command=returnOpenOrders | Returns all current unfilled orders for a specified pair, including order ID, time, amount, and status. | POST | Private | api_key, sign, currencyPair, startAt, endAt | orderNumber, date, startingAmount, total, type, prize, success_count, success_amount, status | https://www.coinw.com/api-doc/spot-trading/check/get-current-orders |
| 3.2 | Get historical orders | /api/v1/private?command=getUserTrades | Retrieves historical orders across pairs, with optional symbol filtering. Up to 100 records per request. | POST | Private | api_key, sign, symbol | tradeId, orderId, price, size, side, orderType, time, fee, before, and 10 total fields | https://www.coinw.com/api-doc/spot-trading/check/get-historical-orders |
| 3.3 | Batch get historical orders | /v1/private?command=getBatchHistoryOrders | Batch query historical orders (last 3 months) by order ID list (see api-doc 3.3 for details). | POST | Private | api_key, sign, orderIds | data, orderId, date, side, type, dealSize, dealFunds, dealAvgPrice, fee, and 16 total fields | https://www.coinw.com/api-doc/spot-trading/check/get-batch-historical-orders |
| 3.4 | Get order details | /api/v1/private?command=returnOrderTrades | Returns detailed information for a specified order ID. | POST | Private | api_key, sign, orderNumber | tradeID, currencyPair, type, amount, success_amount, total, success_total, fee, date, and 10 total fields | https://www.coinw.com/api-doc/spot-trading/check/get-order-details |
| 3.5 | Get order status | /api/v1/private?command=returnOrderStatus | Queries order status by order ID, including pair, side, amount, execution status, and timestamp. | POST | Private | api_key, sign, orderNumber | currencyPair, type, total, startingAmount, status, date | https://www.coinw.com/api-doc/spot-trading/check/get-order-status |
| 3.6 | Get trade history | /api/v1/private?command=returnUTradeHistory | Returns trade history records for a specified pair. | POST | Private | api_key, sign, currencyPair | tradeID, type, amount, success_amount, total, success_count, fee, prize, date, and 11 total fields | https://www.coinw.com/api-doc/spot-trading/check/get-transaction-history |
| No. | name | Endpoint | Description | Method | Authentication | Input Parameters | Output Parameters | Detailed Doc URL |
|---|---|---|---|---|---|---|---|---|
| 4.1 | Get spot account balance | /api/v1/private?command=returnBalances | Retrieves available balances in the user's spot account across supported assets. | POST | Private | api_key, sign | data, msg | https://www.coinw.com/api-doc/spot-trading/account/get-spot-account-balance |
| 4.2 | Get complete spot balances | /api/v1/private?command=returnCompleteBalances | Retrieves full spot balance details, including available balances and order-frozen balances. | POST | Private | api_key, sign | data, available, onOrders | https://www.coinw.com/api-doc/spot-trading/account/get-total-spot-account-balance |
| 4.7 | Asset transfer | /api/v1/private?command=spotWealthTransfer | Transfers assets between the spot account and funding account for fund management. | POST | Private | api_key, sign, accountType, targetAccountType, bizType, coinCode, amount | data, msg | https://www.coinw.com/api-doc/spot-trading/account/transfer-assets |
https://api.coinw.com.GET/POST https://api.coinw.com/api/v1/public?command=....POST https://api.coinw.com/api/v1/private?command=..., with api_key and sign (MD5, see Reference) in query/body./v1/private?command=... alongside /api/v1/private; follow actual implementation.command values (private/public endpoints covered in this file)cancelAllOrder, cancelOrder, doTrade, getBatchHistoryOrders, getUserTrades, return24hVolume, returnBalances, returnChartData, returnCompleteBalances, returnOpenOrders, returnOrderBook, returnOrderStatus, returnOrderTrades, returnSymbol, returnTicker, returnTradeHistory, returnUTradeHistory, spotWealthTransfer
BTC_USDT (field names vary by endpoint).code, msg / message, success, failed, data (actual response varies by endpoint).LIMIT, MARKET, HL_LIMIT, PLANNING, STOP_LIMIT_ORDER, SMART_MARKET_ORDER, ICEBERG, etc.curl "https://api.coinw.com/api/v1/public?command=returnSymbol"
params="api_key=$COINW_API_KEY&amount=0.001&funds=1&isMarket=1&out_trade_no=1&rate=40000&symbol=BTC_USDT"
sign_string="$params&secret_key=$COINW_SECRET_KEY"
sign=$(echo -n "$sign_string" | openssl md5 | cut -d' ' -f2 | tr '[:lower:]' '[:upper:]')
curl -X POST "https://api.coinw.com/api/v1/private?command=doTrade&$params&sign=$sign"
When showing credentials to users:
12&*1...198I***...isf1api_key and secret_key in a secure location.When user provides new credentials:
./references/Authentication.md./references/error-codes.md./references/notes.md./references/api-key-creation-steps.md