欢迎使用全新的 WEEX API 文档。需要查看旧版本?切换到旧版文档
WEEX
WEEX 合约 REST API

账户

端点

查询账户余额 (USER_DATA)

查询账户余额 (USER_DATA)。

GET
/capi/v3/account/balance
https://api-contract.weex.com
请求权重
此端点消耗基于 IP 的请求权重。较重的端点会消耗更多您的 IP 速率限制容量。
请在访问限制章节中了解更多信息。
IP 权重5

查询账户余额 (USER_DATA) › 响应

200

成功响应

​object[]
asset
​string

资产名称

balance
​string

总余额

availableBalance
​string

可用余额

frozen
​string

冻结资产

unrealizePnl
​string

未实现盈亏


查询手续费率 (USER_DATA)

查询手续费率 (USER_DATA)。

GET
/capi/v3/account/commissionRate
https://api-contract.weex.com
请求权重
此端点消耗基于 IP 的请求权重。较重的端点会消耗更多您的 IP 速率限制容量。
请在访问限制章节中了解更多信息。
IP 权重5

查询手续费率 (USER_DATA) › 查询参数

symbol
​string · required

交易对

查询手续费率 (USER_DATA) › 响应

200

成功响应

symbol
​string

交易对

makerCommissionRate
​string

当前用户手动下单适用的 Maker 手续费率,例如 "0.0002" 表示 0.02%

takerCommissionRate
​string

当前用户手动下单适用的 Taker 手续费率,例如 "0.0004" 表示 0.04%

apiMakerCommissionRate
​string

当前用户通过 API 下单适用的 Maker 手续费率,例如 "0.0002" 表示 0.02%

apiTakerCommissionRate
​string

当前用户通过 API 下单适用的 Taker 手续费率,例如 "0.0004" 表示 0.04%


查询账户配置 (USER_DATA)

查询账户配置 (USER_DATA)。

GET
/capi/v3/account/accountConfig
https://api-contract.weex.com
请求权重
此端点消耗基于 IP 的请求权重。较重的端点会消耗更多您的 IP 速率限制容量。
请在访问限制章节中了解更多信息。
IP 权重5

查询账户配置 (USER_DATA) › 响应

200

成功响应

canTrade
​boolean

是否已开启交易

canDeposit
​boolean

是否允许充值

canWithdraw
​boolean

是否允许提现

dualSidePosition
​boolean

是否启用双向持仓模式。true 表示可同时持有多空仓位,false 表示单向模式

updateTime
​integer

更新时间Unix 毫秒时间戳


查询交易对配置 (USER_DATA)

查询交易对配置 (USER_DATA)。

GET
/capi/v3/account/symbolConfig
https://api-contract.weex.com
请求权重
此端点消耗基于 IP 的请求权重。较重的端点会消耗更多您的 IP 速率限制容量。
请在访问限制章节中了解更多信息。
IP 权重5

查询交易对配置 (USER_DATA) › 查询参数

symbol
​string

交易对,留空时返回全部交易对的配置

查询交易对配置 (USER_DATA) › 响应

200

成功响应

​object[]
symbol
​string

交易对

marginType
​string

保证金模式。CROSSED 表示全仓,ISOLATED 表示逐仓。

separatedType
​string

分仓模式。COMBINED 表示合仓,SEPARATED 表示分仓。

crossLeverage
​string

全仓杠杆倍数

isolatedLongLeverage
​string

逐仓多单杠杆倍数

isolatedShortLeverage
​string

逐仓空单杠杆倍数


获取账户资金流水 (USER_DATA)

获取账户资金流水 (USER_DATA)。

POST
/capi/v3/account/income
https://api-contract.weex.com
请求权重
此端点消耗基于 IP 的请求权重。较重的端点会消耗更多您的 IP 速率限制容量。
请在访问限制章节中了解更多信息。
IP 权重2

获取账户资金流水 (USER_DATA) › 查询参数

asset
​string

资产名称

symbol
​string

交易对

incomeType
​string

业务类型deposit 充值withdraw 提现transfer_in 不同账户间的转入transfer_out 不同账户间的转出margin_move_in 同一账户下因为开仓/平仓/手动/自动追加而转入的抵押品margin_move_out 同一账户下因为开仓/平仓/手动/自动追加而转出的抵押品position_open_long 开多导致的抵押品变化(买入减少抵押品)position_open_short 开空导致的抵押品变化(卖出增加抵押品)position_close_long 平多导致的抵押品变化(卖出增加抵押品)position_close_short 平空导致的抵押品变化(买入减少抵押品)position_funding 仓位资金费用结算导致的抵押品变化order_fill_fee_income 委托单成交手续费收入(手续费账户特有)order_liquidate_fee_income 委托单清算手续费收入(手续费账户特有)start_liquidate 设置开始清算finish_liquidate 设置结束清算order_fix_margin_amount 补偿穿仓金额tracking_follow_pay 跟单支出,跟随者在平仓后,如果有盈利,进行预扣tracking_system_pre_receive 预收分佣,分佣系统账户收跟随的预扣款tracking_follow_back 跟单退佣tracking_trader_income 带单收入tracking_third_party_share 分享分润(交易员分享给别人的)

startTime
​integer

开始时间戳 单位:毫秒。仅填写 endTime 时,系统默认将 startTime 设为 endTime 向前 30 天(不会早于当前时间)。

endTime
​integer

结束时间戳 单位:毫秒。仅填写 startTime 时,系统默认将 endTime 设为当前时间。当同时填写时,时间跨度不得超过 100 天。

limit
​integer

返回条数限制,默认20 最小值:1最大值:100

nextKeyId
​integer

上一页返回的游标 ID

nextKeyTime
​integer

上一页返回的游标时间

获取账户资金流水 (USER_DATA) › 响应

200

成功响应

hasNextPage
​boolean

是否存在下一页

​object

下一页游标

​object[]

数据列表


查询全部仓位 (USER_DATA)

查询全部仓位 (USER_DATA)。

GET
/capi/v3/account/position/allPosition
https://api-contract.weex.com
请求权重
此端点消耗基于 IP 的请求权重。较重的端点会消耗更多您的 IP 速率限制容量。
请在访问限制章节中了解更多信息。
IP 权重10

查询全部仓位 (USER_DATA) › 响应

200

成功响应

​object[]
id
​integer

仓位 ID

asset
​string

所属抵押品资产

symbol
​string

交易对

side
​string

持仓方向(如 LONG、SHORT)

marginType
​string

保证金模式。CROSSED 表示全仓,ISOLATED 表示逐仓。

separatedMode
​string

分仓模式。COMBINED 表示合仓,SEPARATED 表示分仓。

separatedOpenOrderId
​integer

分仓开仓委托单 ID

leverage
​string

仓位杠杆倍数

size
​string

当前持仓数量

openValue
​string

开仓价值

openFee
​string

开仓手续费

fundingFee
​string

资金费用

marginSize
​string

保证金额度(以保证金币种计)

isolatedMargin
​string

逐仓保证金

isAutoAppendIsolatedMargin
​boolean

是否启用自动追加逐仓保证金(仅逐仓有效)

cumOpenSize
​string

累计开仓数量

cumOpenValue
​string

累计开仓价值

cumOpenFee
​string

累计开仓手续费

cumCloseSize
​string

累计平仓数量

cumCloseValue
​string

累计平仓价值

cumCloseFee
​string

累计平仓手续费

cumFundingFee
​string

累计已结算资金费用

cumLiquidateFee
​string

累计清算(强平)费用

createdMatchSequenceId
​integer

创建时对应撮合引擎序号

updatedMatchSequenceId
​integer

最新更新对应撮合引擎序号

createdTime
​integer

创建时间Unix 毫秒时间戳

updatedTime
​integer

更新时间Unix 毫秒时间戳

unrealizePnl
​string

未实现盈亏

liquidatePrice
​string

预估强平价。为 0 表示当前无爆仓风险


查询单个仓位 (USER_DATA)

查询单个仓位 (USER_DATA)。

GET
/capi/v3/account/position/singlePosition
https://api-contract.weex.com
请求权重
此端点消耗基于 IP 的请求权重。较重的端点会消耗更多您的 IP 速率限制容量。
请在访问限制章节中了解更多信息。
IP 权重2

查询单个仓位 (USER_DATA) › 查询参数

symbol
​string · required

交易对

查询单个仓位 (USER_DATA) › 响应

200

成功响应

​object[]
id
​integer

仓位 ID

asset
​string

所属抵押品资产

symbol
​string

交易对

side
​string

持仓方向(如 LONG、SHORT)

marginType
​string

保证金模式。CROSSED 表示全仓,ISOLATED 表示逐仓。

separatedMode
​string

分仓模式。COMBINED 表示合仓,SEPARATED 表示分仓。

separatedOpenOrderId
​integer

分仓开仓委托单 ID

leverage
​string

仓位杠杆倍数

size
​string

当前持仓数量

openValue
​string

开仓价值

openFee
​string

开仓手续费

fundingFee
​string

资金费用

marginSize
​string

保证金额度(以保证金币种计)

isolatedMargin
​string

逐仓保证金

isAutoAppendIsolatedMargin
​boolean

是否启用自动追加逐仓保证金(仅逐仓有效)

cumOpenSize
​string

累计开仓数量

cumOpenValue
​string

累计开仓价值

cumOpenFee
​string

累计开仓手续费

cumCloseSize
​string

累计平仓数量

cumCloseValue
​string

累计平仓价值

cumCloseFee
​string

累计平仓手续费

cumFundingFee
​string

累计已结算资金费用

cumLiquidateFee
​string

累计清算(强平)费用

createdMatchSequenceId
​integer

创建时对应撮合引擎序号

updatedMatchSequenceId
​integer

最新更新对应撮合引擎序号

createdTime
​integer

创建时间Unix 毫秒时间戳

updatedTime
​integer

更新时间Unix 毫秒时间戳

unrealizePnl
​string

未实现盈亏

liquidatePrice
​string

预估强平价。为 0 表示当前无爆仓风险


切换保证金模式 (TRADE)

切换保证金模式 (TRADE)。

POST
/capi/v3/account/marginType
https://api-contract.weex.com
请求权重
此端点消耗基于 IP 的请求权重。较重的端点会消耗更多您的 IP 速率限制容量。
请在访问限制章节中了解更多信息。
IP 权重20

切换保证金模式 (TRADE) › 查询参数

symbol
​string · required

交易对

marginType
​string · required

保证金模式。可选值:CROSSED(全仓),ISOLATED(逐仓)。

separatedType
​string

分仓模式。COMBINED 表示合仓模式,SEPARATED 表示分仓模式。

切换保证金模式 (TRADE) › 响应

200

成功响应

code
​string

返回码

msg
​string

返回信息

requestTime
​integer

时间戳Unix 毫秒时间戳


调整杠杆设置 (TRADE)

调整杠杆设置 (TRADE)。

POST
/capi/v3/account/leverage
https://api-contract.weex.com
请求权重
此端点消耗基于 IP 的请求权重。较重的端点会消耗更多您的 IP 速率限制容量。
请在访问限制章节中了解更多信息。
IP 权重10

调整杠杆设置 (TRADE) › 查询参数

symbol
​string · required

交易对

marginType
​string

目标保证金模式。可选值:CROSSED(全仓)、ISOLATED(逐仓)。

crossLeverage
​string

全仓杠杆,当 marginType 为 CROSSED 时应填写。

isolatedLongLeverage
​string

逐仓多单杠杆,需要调整逐仓多头时填写。

isolatedShortLeverage
​string

逐仓空单杠杆,需要调整逐仓空头时填写。

调整杠杆设置 (TRADE) › 响应

200

成功响应

symbol
​string

交易对

marginType
​string

生效的保证金模式

crossLeverage
​string

当前全仓杠杆

isolatedLongLeverage
​string

当前逐仓多单杠杆

isolatedShortLeverage
​string

当前逐仓空单杠杆


调整逐仓保证金 (TRADE)

调整逐仓保证金 (TRADE)。

POST
/capi/v3/account/positionMargin
https://api-contract.weex.com
请求权重
此端点消耗基于 IP 的请求权重。较重的端点会消耗更多您的 IP 速率限制容量。
请在访问限制章节中了解更多信息。
IP 权重15

调整逐仓保证金 (TRADE) › 查询参数

isolatedPositionId
​integer · required

逐仓仓位 ID。可通过 查询单个仓位 获取。

amount
​string · required

调整的保证金数量,必须大于 0。

type
​integer · required

调整方向。1 表示增加逐仓保证金,2 表示减少逐仓保证金。

调整逐仓保证金 (TRADE) › 响应

200

成功响应

code
​string

返回码

msg
​string

返回信息

requestTime
​integer

时间戳Unix 毫秒时间戳


设置自动追加保证金 (TRADE)

设置自动追加保证金 (TRADE)。

POST
/capi/v3/account/modifyAutoAppendMargin
https://api-contract.weex.com
请求权重
此端点消耗基于 IP 的请求权重。较重的端点会消耗更多您的 IP 速率限制容量。
请在访问限制章节中了解更多信息。
IP 权重15

设置自动追加保证金 (TRADE) › 查询参数

positionId
​integer · required

逐仓仓位 ID

autoAppendMargin
​boolean · required

是否启用自动追加逐仓保证金

设置自动追加保证金 (TRADE) › 响应

200

成功响应

code
​string

返回码

msg
​string

返回信息

requestTime
​integer

时间戳Unix 毫秒时间戳