npx skills add https://github.com/connectcoinw/coinw-skills --skill 'Coinw Contract Skill'Coinw 合约 REST API 技能:涵盖市场数据、下单/撤单、止盈止损、仓位和订单查询、账户资产、仓位模式和杠杆。
| 序号 | 名称 | 端点 | 描述 | 方法 | 鉴权 | 输入参数 | 输出参数 |
|---|---|---|---|---|---|---|---|
| 1.1 | 获取交易对信息 | /v1/perpum/instruments | 查询所有交易对的基本信息,包括杠杆、保证金、止盈止损比例、挂单/吃单费率、资金费率、最大持仓量等。 | GET | 公开 | name | base, defaultLeverage, defaultStopLossRate, defaultStopProfitRate, indexId, leverage, makerFee, maxLeverage, minLeverage, 共 37 个字段 |
| 1.2 | 批量获取交易对信息 | /v1/perpum/instrumentList | 批量查询多个交易对的基本信息,包括杠杆、保证金要求、费率参数和最大持仓量。 | GET | 公开 | symbols | base, defaultLeverage, defaultStopLossRate, defaultStopProfitRate, indexId, leverage, makerFee, maxLeverage, minLeverage, 共 38 个字段 |
| 序号 | 名称 | 端点 | 描述 | 方法 | 鉴权 | 输入参数 | 输出参数 |
|---|---|---|---|---|---|---|---|
| 2.1 | 下单 | /v1/perpum/order | 下达合约订单。支持市价单、限价单和条件单类型。 | POST | 私有 | api_key, sign, instrument, direction, leverage, quantityUnit, quantity, positionModel, positionType, openPrice, stopProfitPrice, stopLossPrice, thirdOrderId | code, data |
| 2.2 | 批量下单 | /v1/perpum/batchOrders | 批量下达合约订单,支持市价单、限价单和条件单类型。 | POST | 私有 | api_key, sign, instrument, direction, leverage, quantityUnit, quantity, positionModel, positionType, openPrice, stopProfitPrice, stopLossPrice, triggerPrice, triggerType, thirdOrderId |
| 序号 | 名称 | 端点 | 描述 | 方法 | 鉴权 | 输入参数 | 输出参数 |
|---|---|---|---|---|---|---|---|
| 3.1 | 获取未成交订单 | /v1/perpum/orders/open | 按交易对和订单类型查询未成交订单,包括方向、数量、保证金、杠杆、费用和时间戳。 | GET | 私有 | api_key, sign, instrument, positionType | id, userId, baseSize, createdDate, currentPiece, direction, frozenFee, indexPrice, instrument, 共 28 个字段 |
| 3.2 | 获取未成交订单数量 | /v1/perpum/orders/openQuantity | 返回未成交(挂单)订单的总数。挂单数据仅通过 RESTful API 提供。 | GET | 私有 | api_key, sign | data |
| 3.3 |
| 序号 | 名称 | 端点 | 描述 | 方法 | 鉴权 | 输入参数 | 输出参数 |
|---|---|---|---|---|---|---|---|
| 4.1 | 获取当前持仓 | /v1/perpum/positions | 按交易对查询当前开仓的持仓(已成交订单)。也可以使用一个或多个仓位 ID 查询特定持仓。 | GET | 私有 | api_key, sign, instrument | id, base, baseSize, createdDate, currentPiece, direction, fee, fundingSettle, indexPrice, 共 37 个字段 |
| 4.2 | 获取历史持仓 | /v1/perpum/positions/history | 查询所有历史持仓(已成交订单),可按标的/交易对和仓位保证金模式进行筛选。 | GET | 私有 | api_key, sign, instrument, positionModel | avgOpenPrice, completeUsdt, direction, entrustUsdt, fee, havShortfall, indexPrice, instrument, leverage, 共 22 个字段 |
| 序号 | 名称 | 端点 | 描述 | 方法 | 鉴权 | 输入参数 | 输出参数 |
|---|---|---|---|---|---|---|---|
| 5.1 | 获取最大可划转余额 | /v1/perpum/account/available | 查询合约账户可划出的最大金额。 | GET | 私有 | api_key, sign | data.value |
| 5.2 | 获取成交详情(3天) | /v1/perpum/orders/deals | 最近 3 天的成交/资金详情(参见 api-doc 说明)。 | GET | 私有 | api_key, sign, instrument, page, pageSize, originType, positionModel | data.rows, nextId, prevId, total |
| 5.3 | 获取成交详情(3个月) |
| 序号 | 名称 | 端点 | 描述 | 方法 | 鉴权 | 输入参数 | 输出参数 |
|---|---|---|---|---|---|---|---|
| 6.1 | 获取杠杆信息 | /v1/perpum/positions/leverage | 查询一个已成交仓位(positionId)或一个未成交订单(orderId)的杠杆,二选一。 | GET | 私有 | api_key, sign, positionId 或 orderId | data.value |
https://api.coinw.com。GET https://api.coinw.com/v1/perpum/... 或 .../v1/perpumPublic/...。api_key 和 sign(MD5,参见参考文档)。0 合并持仓,1 分开持仓(与 /v1/perpum/positions/type GET/POST 中的 positionModel 一起使用)。1 张数 -> 币种,2 币种 -> 张数(pieceConvert)。0 待生效 到 4 发放失败;状态(POST) : 1 开启 / 关闭。code, msg / message, success, failed, data(实际响应因端点而异)。1:USDT 保证金永续合约(参见 api-doc)。0 逐仓,1 全仓(遵循 api-doc 措辞)。offline, online, pretest, settlement, preOffline。curl "https://api.coinw.com/v1/perpumPublic/tickers"
params="api_key=$COINW_API_KEY"
sign_string="$params&secret_key=$COINW_SECRET_KEY"
sign=$(echo -n "$sign_string" | openssl md5 | cut -d' ' -f2 | tr '[:lower:]' '[:upper:]')
curl -X DELETE "https://api.coinw.com/v1/perpum/allpositions&$params&sign=$sign"
api_key 或 secret_key;如果必须显示,请隐藏中间部分,仅保留最后四个字符。api_key 和 secret_key 存储在安全的位置。当用户提供新凭据时:
TOOLS.md 中,并显示隐藏后的确认信息./references/Authentication.md./references/errorcode.md./references/notes.md./references/api-key-creation-steps.md每周安装次数
–
代码仓库
首次出现时间
–
安全审计
Coinw Contract REST API skill: covers market data, order placement/cancellation, TP/SL, position and order queries, account assets, position modes, and leverage.
| No. | name | Endpoint | Description | Method | Authentication | Input Parameters | Output Parameters |
|---|---|---|---|---|---|---|---|
| 1.1 | Get instrument info | /v1/perpum/instruments | Queries basic information for all instruments, including leverage, margin, TP/SL ratios, maker/taker fee, funding rate, max position size, etc. |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 1.3 | 获取单个交易对最新行情 | /v1/perpumPublic/ticker | 返回单个交易对的最新行情摘要,包括最高/最低价、最大杠杆、成交量、最新价和合约面值。 | GET | 公开 | instrument | contract_id, name, base_coin, quote_coin, price_coin, max_leverage, contract_size, last_price, high, 共 13 个字段 |
| 1.4 | 批量获取最新行情摘要 | /v1/perpumPublic/ticker/list | 批量查询多个交易对的最新行情摘要。 | GET | 公开 | symbols | contract_id, name, base_coin, quote_coin, price_coin, max_leverage, contract_size, last_price, high, 共 13 个字段 |
| 1.5 | 获取所有交易对最新行情摘要 | /v1/perpumPublic/tickers | 返回交易所所有交易对的最新行情摘要。 | GET | 公开 | — | contract_id, name, base_coin, quote_coin, price_coin, max_leverage, contract_size, last_price, high, 共 13 个字段 |
| 1.6 | 按交易对获取历史K线数据 | /v1/perpumPublic/klines | 查询单个交易对的历史和最新K线数据,包括开盘价、最高价、最低价、收盘价、时间戳和成交量。 | GET | 公开 | 参见 api-doc 1.6(例如粒度、klineType、limit、报价币种和时间范围参数) | K线数组:每个条目包含时间戳、最高价/开盘价/最低价/收盘价和成交量 |
| 1.7 | 获取最新结算资金费率 | /v1/perpum/fundingRate | 返回最近一次结算时间的资金费率。不一定与下一次结算费率相关。 | GET | 公开 | instrument | data |
| 1.8 | 按交易对获取订单簿 | /v1/perpumPublic/depth | 查询指定交易对的订单簿深度,包括买盘和卖盘。 | GET | 公开 | base | asks, bids, m, p, n |
| 1.9 | 按交易对获取交易数据 | /v1/perpumPublic/trades | 查询指定交易对的近期交易数据,包括数量、方向、ID、时间戳和价格。默认返回最近 20 笔交易。 | GET | 公开 | base | createdDate, piece, direction, price, quantity, id |
| 1.10 | 获取所有交易对的保证金要求 | /v1/perpum/ladders | 查询所有交易对的阶梯式保证金要求,包括初始/维持保证金和最大杠杆。 | GET | 私有 | api_key, sign | id, instrument, ladder, lastLadder, marginKeepRate, maxLeverage, marginStartRate, maxPiece |
| 1.11 | 获取历史公共交易记录 | /v1/perpum/orders/trades | 查询指定交易对的历史公共交易记录。历史公共交易记录仅通过 RESTful API 提供。 | GET | 私有 | api_key, sign, instrument, pageSize | closedPiece, createdDate, dealPrice, direction, id |
| code, openId, thirdOrderId |
| 2.3 | 平仓 | /v1/perpum/positions | 部分或全部平掉一个已开仓的合约仓位(已成交订单)。支持按固定数量或按仓位百分比平仓。 | DELETE | 私有 | api_key, sign, id, positionType, closeNum, orderPrice | data |
| 2.4 | 批量平仓 | /v1/perpum/batchClose | 使用 thirdOrderId 值批量以市价平掉多个仓位。 | DELETE | 私有 | api_key, sign, thirdOrderId | openId, thirdOrderId |
| 2.5 | 市价平掉所有仓位 | /v1/perpum/allpositions | 以市价平掉指定交易对的所有仓位。 | DELETE | 私有 | api_key, sign | — |
| 2.6 | 反向开仓 | /v1/perpum/positions/reverse | 立即反向开仓,即平掉现有永续仓位并以相同数量在相反方向开仓。 | POST | 私有 | api_key, sign, id | data |
| 2.7 | 调整保证金 | /v1/perpum/positions/margin | 通过增加或减少保证金金额来调整现有仓位(已成交订单)的保证金。 | POST | 私有 | api_key, sign, id, addMargin | msg |
| 2.8 | 设置止盈止损 | /v1/perpum/TPSL | 为已成交或未成交订单设置止盈(TP)和止损(SL)。 | POST | 私有 | api_key, sign, id, instrument, stopProfitPrice, stopLossPrice | msg |
| 2.9 | 设置移动止盈止损 | /v1/perpum/moveTPSL | 通过回调率配置移动止盈止损。仅适用于已成交订单。 | POST | 私有 | api_key, sign, openId, callbackRate, quantity, quantityUnit | — |
| 2.10 | 批量设置止盈止损 | /v1/perpum/addTpsl | 为合约交易订单批量设置止盈止损。 | POST | 私有 | api_key, sign, id, instrument, stopLossPrice, stopProfitPrice, priceType, stopFrom, stopType, closePiece | msg |
| 2.11 | 批量更新止盈止损 | /v1/perpum/updateTpsl | 批量修改合约交易的止盈止损订单。 | POST | 私有 | api_key, sign, id, instrument, stopLossPrice, stopProfitPrice, priceType, stopFrom, stopType, closePiece | msg |
| 2.12 | 修改订单 | /v1/perpum/order | 修改一个未成交订单。某些字段(例如保证金和杠杆)无法通过此端点更改。 | PUT | 私有 | api_key, sign, id, instrument, direction, leverage, quantityUnit, quantity, positionModel, positionType, openPrice, stopProfitPrice, stopLossPrice, triggerPrice, triggerType | originId, editId |
| 2.13 | 取消订单 | /v1/perpum/order | 根据订单 ID 取消一个未成交订单。 | DELETE | 私有 | api_key, sign, id | msg |
| 2.14 | 批量取消订单 | /v1/perpum/batchOrders | 批量取消多个未成交订单。 | DELETE | 私有 | api_key, sign, sourceIds | — |
| 获取止盈止损信息 |
/v1/perpum/TPSL |
| 查询已成交和未成交合约订单的止盈止损信息。 |
| GET |
| 私有 |
| api_key, sign, openId, stopFrom |
| currentPiece, closePiece, direction, createdDate, updatedDate, id, indexPrice, instrument, leverage, 共 24 个字段 |
| 3.4 | 获取移动止盈止损信息 | /v1/perpum/moveTPSL | 查询合约交易的移动止盈止损详情。 | GET | 私有 | api_key, sign | baseSize, callbackRate, createdDate, currentPiece, direction, fee, instrument, leverage, margin, 共 31 个字段 |
| 3.5 | 获取历史订单(7天) | /v1/perpum/orders/history | 返回最近 7 天的历史订单记录,支持分页和筛选。 | GET | 私有 | api_key, sign, page, pageSize, originType, instrument | userId, baseSize, completeUsdt, createdDate, currentPiece, direction, entrustUsdt, havShortfall, hedgeId, 共 37 个字段 |
| 3.6 | 批量获取历史订单(7天) | /v1/perpum/orders/batchInsHistory | 通过 symbols 批量查询最近 7 天的历史订单记录。 | GET | 私有 | api_key, sign, page, pageSize, originType, symbols | userId, baseSize, completeUsdt, createdDate, currentPiece, direction, entrustUsdt, havShortfall, hedgeId, 共 37 个字段 |
| 3.7 | 获取历史订单(3个月) | /v1/perpum/orders/archive | 返回最近 3 个月的历史订单记录,支持分页和筛选。 | GET | 私有 | api_key, sign, page, pageSize, originType, instrument | userId, baseSize, completeUsdt, createdDate, currentPiece, direction, entrustUsdt, havShortfall, hedgeId, 共 37 个字段 |
| 3.8 | 批量获取历史订单(3个月) | /v1/perpum/orders/batchInsArchive | 通过 symbols 批量查询最近 3 个月的历史订单记录。 | GET | 私有 | api_key, sign, page, pageSize, originType, symbols | userId, baseSize, completeUsdt, createdDate, currentPiece, direction, entrustUsdt, havShortfall, hedgeId, 共 37 个字段 |
| 3.9 | 获取订单信息 | /v1/perpum/order | 返回当前未成交订单信息。可以通过订单 ID 列表查询;如果未指定交易对/订单 ID,则返回给定订单类型下的所有订单。 | GET | 私有 | api_key, sign, positionType, sourceIds | id, baseSize, contractType, userId, fee, createdDate, currentPiece, direction, frozenFee, 共 35 个字段 |
| 4.3 | 获取持仓保证金率 | /v1/perpum/positions/marginRate | 根据仓位 ID 查询仓位(已成交订单)的保证金率。 | GET | 私有 | api_key, sign, positionId | data |
| 4.4 | 获取最大合约数量 | /v1/perpum/orders/maxSize | 根据交易对、杠杆和仓位模式查询最大可用合约数量(多/空)。可提供开仓价格。 | GET | 私有 | api_key, sign, leverage, instrument, positionModel, orderPrice | maxBuy, maxSell |
| 4.5 | 获取所有当前持仓 | /v1/perpum/positions/all | 查询所有当前开仓的持仓(已成交订单)。 | GET | 私有 | api_key, sign | id, base, baseSize, createdDate, currentPiece, closedPiece, direction, fee, fundingSettle, 共 30 个字段 |
/v1/perpum/orders/deals/history |
| 最近 3 个月的成交/资金详情(字段同 5.2)。 |
| GET |
| 私有 |
| api_key, sign, instrument, page, pageSize, originType, positionModel |
| data.rows, nextId, prevId, total |
| 5.4 | 获取合约账户资产 | /v1/perpum/account/getUserAssets | 返回可用保证金、USDT、冻结金额、全能金及相关字段(注意 availableMargin 的含义)。 | GET | 私有 | api_key, sign | availableMargin, availableUsdt, alMargin, alFreeze, almightyGold, userId, time |
| 5.5 | 获取合约账户费率 | /v1/perpum/account/fees | 查询挂单/吃单费率。 | GET | 私有 | api_key, sign | makerFee, takerFee, userId |
| 5.6 | 获取全能金余额 | /v1/perpum/account/almightyGoldInfo | 按状态和其他条件筛选全能金记录(GET)。 | GET | 私有 | api_key, sign, type, startTime?, endTime? | data[] (id, currentAmount, totalAmount, type, 等) |
| 5.7 | 单位换算 | /v1/perpum/pieceConvert | 在合约张数和币种数量之间进行转换。 | POST | 私有 | api_key, sign, convertType, faceValue, dealPiece?/baseSize? | data.value |
| 5.8 | 获取仓位模式 | /v1/perpum/positions/type | 查询逐仓/全仓模式和合并/分开布局(GET)。 | GET | 私有 | api_key, sign | layout, positionModel |
| 5.9 | 设置仓位模式 | /v1/perpum/positions/type | 设置逐仓/全仓模式和布局(POST);切换前必须没有未平仓订单。 | POST | 私有 | api_key, sign, positionModel, layout | data (TRANSACTION_SUCCESS) |
| 5.10 | 启用/禁用全能金 | /v1/perpum/account/almightyGoldInfo | 启用或禁用全能金(与 5.6 相同路径的 POST)。 | POST | 私有 | api_key, sign, status | code, msg |
| 5.11 | 获取用户最大可用合约数量 | /v1/perpum/orders/availSize | 从已持仓角度返回可用买入/卖出数量(与 4.4 maxSize 的用例不同)。 | GET | 私有 | api_key, sign, instrument | availBuy, availSell |
0triggerPrice 条件满足时的订单类型:0 = 限价,1 = 市价。| GET |
| Public |
| name |
| base, defaultLeverage, defaultStopLossRate, defaultStopProfitRate, indexId, leverage, makerFee, maxLeverage, minLeverage, and 37 total fields |
| 1.2 | Get batch instrument info | /v1/perpum/instrumentList | Batch query basic information for multiple instruments in one request, including leverage, margin requirements, fee parameters, and max position size. | GET | Public | symbols | base, defaultLeverage, defaultStopLossRate, defaultStopProfitRate, indexId, leverage, makerFee, maxLeverage, minLeverage, and 38 total fields |
| 1.3 | Get latest ticker for one instrument | /v1/perpumPublic/ticker | Returns latest ticker summary for one instrument, including high/low, max leverage, volume, last price, and contract size. | GET | Public | instrument | contract_id, name, base_coin, quote_coin, price_coin, max_leverage, contract_size, last_price, high, and 13 total fields |
| 1.4 | Get latest ticker summary in batch | /v1/perpumPublic/ticker/list | Batch query latest ticker summary for multiple instruments. | GET | Public | symbols | contract_id, name, base_coin, quote_coin, price_coin, max_leverage, contract_size, last_price, high, and 13 total fields |
| 1.5 | Get latest ticker summary for all instruments | /v1/perpumPublic/tickers | Returns latest ticker summary for all instruments on the exchange. | GET | Public | — | contract_id, name, base_coin, quote_coin, price_coin, max_leverage, contract_size, last_price, high, and 13 total fields |
| 1.6 | Get historical K-line data by instrument | /v1/perpumPublic/klines | Queries historical and latest K-line data for one instrument, including OHLC, timestamp, and volume. | GET | Public | See api-doc 1.6 (for example granularity, klineType, limit, reporting coin, and time-range params) | K-line array: each item includes timestamp, high/open/low/close, and volume |
| 1.7 | Get latest settled funding rate | /v1/perpum/fundingRate | Returns the funding rate at the most recent settlement time. It is not necessarily related to the next settlement rate. | GET | Public | instrument | data |
| 1.8 | Get order book by instrument | /v1/perpumPublic/depth | Queries order book depth for a specified instrument, including bids and asks. | GET | Public | base | asks, bids, m, p, n |
| 1.9 | Get trade data by instrument | /v1/perpumPublic/trades | Queries recent trade data for a specified instrument, including size, side, ID, timestamp, and price. Returns the latest 20 trades by default. | GET | Public | base | createdDate, piece, direction, price, quantity, id |
| 1.10 | Get margin requirements for all instruments | /v1/perpum/ladders | Queries tiered margin requirements for all instruments, including initial/maintenance margin and max leverage. | GET | Private | api_key, sign | id, instrument, ladder, lastLadder, marginKeepRate, maxLeverage, marginStartRate, maxPiece |
| 1.11 | Get historical public trades | /v1/perpum/orders/trades | Queries historical public trade records for a specified instrument. Historical public trades are available via RESTful API only. | GET | Private | api_key, sign, instrument, pageSize | closedPiece, createdDate, dealPrice, direction, id |
| No. | name | Endpoint | Description | Method | Authentication | Input Parameters | Output Parameters |
|---|---|---|---|---|---|---|---|
| 2.1 | Place order | /v1/perpum/order | Places a contract order. Supports market, limit, and trigger order types. | POST | Private | api_key, sign, instrument, direction, leverage, quantityUnit, quantity, positionModel, positionType, openPrice, stopProfitPrice, stopLossPrice, thirdOrderId | code, data |
| 2.2 | Batch place orders | /v1/perpum/batchOrders | Batch places contract orders with support for market, limit, and trigger order types. | POST | Private | api_key, sign, instrument, direction, leverage, quantityUnit, quantity, positionModel, positionType, openPrice, stopProfitPrice, stopLossPrice, triggerPrice, triggerType, thirdOrderId | code, openId, thirdOrderId |
| 2.3 | Close position | /v1/perpum/positions | Partially or fully closes an open contract position (filled order). Supports closing by fixed size or by position percentage. | DELETE | Private | api_key, sign, id, positionType, closeNum, orderPrice | data |
| 2.4 | Batch close positions | /v1/perpum/batchClose | Closes multiple positions at market price in batch using thirdOrderId values. | DELETE | Private | api_key, sign, thirdOrderId | openId, thirdOrderId |
| 2.5 | Market close all positions | /v1/perpum/allpositions | Closes all positions for the specified instrument at market price. | DELETE | Private | api_key, sign | — |
| 2.6 | Reverse position | /v1/perpum/positions/reverse | Instantly reverses an existing perpetual position by closing it and opening the same size in the opposite direction. | POST | Private | api_key, sign, id | data |
| 2.7 | Adjust margin | /v1/perpum/positions/margin | Adjusts margin for an existing position (filled order) by increasing or decreasing margin amount. | POST | Private | api_key, sign, id, addMargin | msg |
| 2.8 | Set TP/SL | /v1/perpum/TPSL | Sets take-profit (TP) and stop-loss (SL) for filled or unfilled orders. | POST | Private | api_key, sign, id, instrument, stopProfitPrice, stopLossPrice | msg |
| 2.9 | Set trailing TP/SL | /v1/perpum/moveTPSL | Configures trailing TP/SL by callback rate. Applies to filled orders only. | POST | Private | api_key, sign, openId, callbackRate, quantity, quantityUnit | — |
| 2.10 | Batch set TP/SL | /v1/perpum/addTpsl | Batch sets TP/SL for contract trading orders. | POST | Private | api_key, sign, id, instrument, stopLossPrice, stopProfitPrice, priceType, stopFrom, stopType, closePiece | msg |
| 2.11 | Batch update TP/SL | /v1/perpum/updateTpsl | Batch modifies TP/SL orders for contract trading. | POST | Private | api_key, sign, id, instrument, stopLossPrice, stopProfitPrice, priceType, stopFrom, stopType, closePiece | msg |
| 2.12 | Modify order | /v1/perpum/order | Modifies an unfilled order. Some fields (for example margin and leverage) cannot be changed via this endpoint. | PUT | Private | api_key, sign, id, instrument, direction, leverage, quantityUnit, quantity, positionModel, positionType, openPrice, stopProfitPrice, stopLossPrice, triggerPrice, triggerType | originId, editId |
| 2.13 | Cancel order | /v1/perpum/order | Cancels an unfilled order by order ID. | DELETE | Private | api_key, sign, id | msg |
| 2.14 | Cancel batch orders | /v1/perpum/batchOrders | Cancels multiple unfilled orders in batch. | DELETE | Private | api_key, sign, sourceIds | — |
| No. | name | Endpoint | Description | Method | Authentication | Input Parameters | Output Parameters |
|---|---|---|---|---|---|---|---|
| 3.1 | Get open orders | /v1/perpum/orders/open | Queries unfilled orders by instrument and order type, including direction, quantity, margin, leverage, fees, and timestamps. | GET | Private | api_key, sign, instrument, positionType | id, userId, baseSize, createdDate, currentPiece, direction, frozenFee, indexPrice, instrument, and 28 total fields |
| 3.2 | Get open order count | /v1/perpum/orders/openQuantity | Returns total number of unfilled (pending) orders. Pending order data is available via RESTful API only. | GET | Private | api_key, sign | data |
| 3.3 | Get TP/SL info | /v1/perpum/TPSL | Queries TP/SL information for both filled and unfilled contract orders. | GET | Private | api_key, sign, openId, stopFrom | currentPiece, closePiece, direction, createdDate, updatedDate, id, indexPrice, instrument, leverage, and 24 total fields |
| 3.4 | Get trailing TP/SL info | /v1/perpum/moveTPSL | Queries trailing TP/SL details for contract trading. | GET | Private | api_key, sign | baseSize, callbackRate, createdDate, currentPiece, direction, fee, instrument, leverage, margin, and 31 total fields |
| 3.5 | Get history orders (7 days) | /v1/perpum/orders/history | Returns historical order records from the last 7 days with pagination and filters. | GET | Private | api_key, sign, page, pageSize, originType, instrument | userId, baseSize, completeUsdt, createdDate, currentPiece, direction, entrustUsdt, havShortfall, hedgeId, and 37 total fields |
| 3.6 | Batch get history orders (7 days) | /v1/perpum/orders/batchInsHistory | Returns historical order records from the last 7 days with batch query via symbols. | GET | Private | api_key, sign, page, pageSize, originType, symbols | userId, baseSize, completeUsdt, createdDate, currentPiece, direction, entrustUsdt, havShortfall, hedgeId, and 37 total fields |
| 3.7 | Get history orders (3 months) | /v1/perpum/orders/archive | Returns historical order records from the last 3 months with pagination and filters. | GET | Private | api_key, sign, page, pageSize, originType, instrument | userId, baseSize, completeUsdt, createdDate, currentPiece, direction, entrustUsdt, havShortfall, hedgeId, and 37 total fields |
| 3.8 | Batch get history orders (3 months) | /v1/perpum/orders/batchInsArchive | Returns historical order records from the last 3 months with batch query via symbols. | GET | Private | api_key, sign, page, pageSize, originType, symbols | userId, baseSize, completeUsdt, createdDate, currentPiece, direction, entrustUsdt, havShortfall, hedgeId, and 37 total fields |
| 3.9 | Get order info | /v1/perpum/order | Returns current unfilled order information. You can query by order ID list; if no instrument/order IDs are specified, all orders under the given order type are returned. | GET | Private | api_key, sign, positionType, sourceIds | id, baseSize, contractType, userId, fee, createdDate, currentPiece, direction, frozenFee, and 35 total fields |
| No. | name | Endpoint | Description | Method | Authentication | Input Parameters | Output Parameters |
|---|---|---|---|---|---|---|---|
| 4.1 | Get current positions | /v1/perpum/positions | Queries currently open positions (filled orders) by instrument. You can also query specific positions using one or more position IDs. | GET | Private | api_key, sign, instrument | id, base, baseSize, createdDate, currentPiece, direction, fee, fundingSettle, indexPrice, and 37 total fields |
| 4.2 | Get historical positions | /v1/perpum/positions/history | Queries all historical positions (filled orders), with optional filtering by base/instrument and position margin mode. | GET | Private | api_key, sign, instrument, positionModel | avgOpenPrice, completeUsdt, direction, entrustUsdt, fee, havShortfall, indexPrice, instrument, leverage, and 22 total fields |
| 4.3 | Get position margin rate | /v1/perpum/positions/marginRate | Queries margin rate for a position (filled order) by position ID. | GET | Private | api_key, sign, positionId | data |
| 4.4 | Get max contract size | /v1/perpum/orders/maxSize | Queries max available contract size (long/short) by instrument, leverage, and position mode. Optional opening price can be provided. | GET | Private | api_key, sign, leverage, instrument, positionModel, orderPrice | maxBuy, maxSell |
| 4.5 | Get all current positions | /v1/perpum/positions/all | Queries all currently open positions (filled orders). | GET | Private | api_key, sign | id, base, baseSize, createdDate, currentPiece, closedPiece, direction, fee, fundingSettle, and 30 total fields |
| No. | name | Endpoint | Description | Method | Authentication | Input Parameters | Output Parameters |
|---|---|---|---|---|---|---|---|
| 5.1 | Get max transferable balance | /v1/perpum/account/available | Queries max amount transferable out from the contract account. | GET | Private | api_key, sign | data.value |
| 5.2 | Get deal details (3 days) | /v1/perpum/orders/deals | Deal/funding details for the recent 3 days (see api-doc notes). | GET | Private | api_key, sign, instrument, page, pageSize, originType, positionModel | data.rows, nextId, prevId, total |
| 5.3 | Get deal details (3 months) | /v1/perpum/orders/deals/history | Deal/funding details for the recent 3 months (same fields as 5.2). | GET | Private | api_key, sign, instrument, page, pageSize, originType, positionModel | data.rows, nextId, prevId, total |
| 5.4 | Get contract account assets | /v1/perpum/account/getUserAssets | Returns available margin, USDT, frozen amounts, almighty-gold, and related fields (note meaning of availableMargin). | GET | Private | api_key, sign | availableMargin, availableUsdt, alMargin, alFreeze, almightyGold, userId, time |
| 5.5 | Get contract account fees | /v1/perpum/account/fees | Queries maker/taker fee rates. | GET | Private | api_key, sign | makerFee, takerFee, userId |
| 5.6 | Get almighty-gold balance | /v1/perpum/account/almightyGoldInfo | Filters almighty-gold records by status and other criteria (GET). | GET | Private | api_key, sign, type, startTime?, endTime? | data[] (id, currentAmount, totalAmount, type, etc.) |
| 5.7 | Unit conversion | /v1/perpum/pieceConvert | Converts between contract pieces and coin amount. | POST | Private | api_key, sign, convertType, faceValue, dealPiece?/baseSize? | data.value |
| 5.8 | Get position mode | /v1/perpum/positions/type | Queries isolated/cross mode and merged/split layout (GET). | GET | Private | api_key, sign | layout, positionModel |
| 5.9 | Set position mode | /v1/perpum/positions/type | Sets isolated/cross mode and layout (POST); there must be no open orders before switching. | POST | Private | api_key, sign, positionModel, layout | data (TRANSACTION_SUCCESS) |
| 5.10 | Enable/disable almighty-gold | /v1/perpum/account/almightyGoldInfo | Enables or disables almighty-gold (POST on same path as 5.6). | POST | Private | api_key, sign, status | code, msg |
| 5.11 | Get user max available contract size | /v1/perpum/orders/availSize | Returns available buy/sell size from the filled-position perspective (different from 4.4 maxSize use case). | GET | Private | api_key, sign, instrument | availBuy, availSell |
| No. | name | Endpoint | Description | Method | Authentication | Input Parameters | Output Parameters |
|---|---|---|---|---|---|---|---|
| 6.1 | Get leverage info | /v1/perpum/positions/leverage | Queries leverage for one filled position (positionId) or one unfilled order (orderId), choose one. | GET | Private | api_key, sign, positionId or orderId | data.value |
https://api.coinw.com.GET https://api.coinw.com/v1/perpum/... or .../v1/perpumPublic/....api_key and sign (MD5, see Reference) in query/body.0 merged positions, 1 split positions (used with positionModel on /v1/perpum/positions/type GET/POST).1 piece -> coin, 2 coin -> piece (pieceConvert).0 pending to effective through 4 issuance failed; status (POST) : 1 on / 0 off.code, msg / message, success, failed, data (actual response varies by endpoint).1: USDT-margined perpetual contract (see api-doc).0 isolated, 1 cross (follow api-doc wording).offline, online, pretest, settlement, preOffline.triggerPrice condition is met: 0 = limit, 1 = market.curl "https://api.coinw.com/v1/perpumPublic/tickers"
params="api_key=$COINW_API_KEY"
sign_string="$params&secret_key=$COINW_SECRET_KEY"
sign=$(echo -n "$sign_string" | openssl md5 | cut -d' ' -f2 | tr '[:lower:]' '[:upper:]')
curl -X DELETE "https://api.coinw.com/v1/perpum/allpositions&$params&sign=$sign"
api_key or secret_key; if shown, mask the middle and keep only the last four characters.api_key and secret_key in a secure location.When user provides new credentials:
TOOLS.md with masked display confirmation./references/Authentication.md./references/errorcode.md./references/notes.md./references/api-key-creation-steps.mdWeekly Installs
–
Repository
First Seen
–
Security Audits
飞书OpenAPI Explorer:探索和调用未封装的飞书原生API接口
19,800 周安装