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

行情

端点

获取服务器时间

获取服务器时间。

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

获取服务器时间 › 响应

200

成功响应

serverTime
​integer

服务器时间Unix 毫秒时间戳


获取合约信息

获取合约信息。

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

获取合约信息 › 查询参数

symbol
​string

交易对;留空时返回全部支持的合约与资产信息。

contractType
​string

合约类型,支持值:PERPETUAL、TRADIFI_PERPETUAL。

underlyingType
​string

底层资产类型。

underlyingSubType
​string

底层资产标签;返回结果中的 underlyingSubType 包含该值即匹配。

获取合约信息 › 响应

200

成功响应

​object[]

抵押品资产列表。每个元素对应 资产对象 (assets[])。

​object[]

API 访问限制。每个元素对应 访问限制对象 (rateLimits[])。

​object[]

合约配置列表。每个元素对应 合约对象 (symbols[])。


获取深度数据

获取深度数据。

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

获取深度数据 › 查询参数

symbol
​string · required

交易对

limit
​integer

深度数量,仅支持 15 或 200,默认 15

获取深度数据 › 响应

200

成功响应

​array[]

买单深度,每个元素为 [价格, 数量]

​array[]

卖单深度,每个元素为 [价格, 数量]

lastUpdateId
​integer

最近一次订单簿更新的版本号


获取24小时行情统计

获取24小时行情统计。

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

获取24小时行情统计 › 查询参数

symbol
​string

交易对,留空返回全部交易对的统计数据

获取24小时行情统计 › 响应

200

成功响应

​object[]
symbol
​string

交易对

priceChange
​string

24 小时价格涨跌额

priceChangePercent
​string

24 小时价格涨跌幅(百分比)

lastPrice
​string

最新成交价

openPrice
​string

24 小时前的开盘价

highPrice
​string

24 小时最高价

lowPrice
​string

24 小时最低价

volume
​string

24 小时成交量(基础资产)

quoteVolume
​string

24 小时成交额(计价资产)

markPrice
​string

最新标记价格

indexPrice
​string

最新指数价格

openTime
​integer

24 小时统计窗口的起始时间(毫秒)

closeTime
​integer

24 小时统计窗口的结束时间(毫秒)


获取最优挂单

获取最优挂单。

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

获取最优挂单 › 查询参数

symbol
​string

交易对,留空返回全部交易对的最优买卖挂单数据

获取最优挂单 › 响应

200

成功响应

​object[]
symbol
​string

交易对

bidPrice
​string

最优买价(买一价)

bidQty
​string

最优买单挂单量

askPrice
​string

最优卖价(卖一价)

askQty
​string

最优卖单挂单量

time
​integer

撮合引擎时间戳(毫秒)


获取最新成交

获取最新成交。

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

获取最新成交 › 查询参数

symbol
​string · required

交易对

limit
​integer

返回条数,范围 1-1000,默认 100

获取最新成交 › 响应

200

成功响应

​object[]
id
​string

成交 ID

time
​integer

成交时间Unix 毫秒时间戳

price
​string

成交价格

qty
​string

成交数量(基础资产)

quoteQty
​string

成交金额(计价资产)

isBestMatch
​boolean

是否为最优匹配

isBuyerMaker
​boolean

买方是否为挂单方


获取K线数据

获取K线数据。

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

获取K线数据 › 查询参数

symbol
​string · required

交易对

interval
​string · required

K线周期,可选:1m、5m、15m、30m、1h、4h、12h、1d、1w。

limit
​integer

返回的K线条数,范围 1-1000,默认 100。

获取K线数据 › 响应

200

成功响应

​array[]
array
index[0]
​integer

开盘时间Unix 毫秒时间戳

Example: 1764505740000
index[1]
​string

开盘价

Example: 69340.1
index[2]
​string

最高价

Example: 69380.0
index[3]
​string

最低价

Example: 69320.5
index[4]
​string

收盘价

Example: 69355.2
index[5]
​string

成交量(基础资产)

Example: 25.678
index[6]
​integer

收盘时间Unix 毫秒时间戳

Example: 1764505800000
index[7]
​string

成交额(计价资产)

Example: 1782223.45
index[8]
​integer

成交笔数

Example: 125
index[9]
​string

主动买入成交量(基础资产)

Example: 12.345
index[10]
​string

主动买入成交额(计价资产)

Example: 856789.12

获取指数价格K线

获取指数价格K线。

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

获取指数价格K线 › 查询参数

symbol
​string · required

交易对

interval
​string · required

K线周期,可选:1m、5m、15m、30m、1h、4h、12h、1d、1w。

limit
​integer

返回的K线条数,范围 1-1000,默认 100。

获取指数价格K线 › 响应

200

成功响应

​array[]
array
index[0]
​integer

开盘时间Unix 毫秒时间戳

Example: 1764492000000
index[1]
​string

开盘价

Example: 69210.5
index[2]
​string

最高价

Example: 69400.0
index[3]
​string

最低价

Example: 69180.4
index[4]
​string

收盘价

Example: 69320.0
index[5]
​string

成交量(基础资产)

Example: 0
index[6]
​integer

收盘时间Unix 毫秒时间戳

Example: 1764495600000
index[7]
​string

成交额(计价资产)

Example: 0
index[8]
​integer

成交笔数

Example: 0
index[9]
​string

主动买入成交量(基础资产)

Example: 0
index[10]
​string

主动买入成交额(计价资产)

Example: 0

获取标记价格K线

获取标记价格K线。

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

获取标记价格K线 › 查询参数

symbol
​string · required

交易对

interval
​string · required

K线周期,可选:1m、5m、15m、30m、1h、4h、12h、1d、1w。

limit
​integer

返回的K线条数,范围 1-1000,默认 100。

获取标记价格K线 › 响应

200

成功响应

​array[]
array
index[0]
​integer

开盘时间Unix 毫秒时间戳

Example: 1764504000000
index[1]
​string

开盘价

Example: 69310.0
index[2]
​string

最高价

Example: 69360.0
index[3]
​string

最低价

Example: 69280.5
index[4]
​string

收盘价

Example: 69340.2
index[5]
​string

成交量(基础资产)

Example: 15.234
index[6]
​integer

收盘时间Unix 毫秒时间戳

Example: 1764504900000
index[7]
​string

成交额(计价资产)

Example: 1056702.43
index[8]
​integer

成交笔数

Example: 64
index[9]
​string

主动买入成交量(基础资产)

Example: 7.100
index[10]
​string

主动买入成交额(计价资产)

Example: 493021.56

获取历史K线

获取历史K线。

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

获取历史K线 › 查询参数

symbol
​string · required

交易对

interval
​string · required

K线周期,可选:1m、5m、15m、30m、1h、4h、12h、1d、1w。

startTime
​integer

起始时间(包含),Unix 毫秒时间戳,不能晚于当前时间。

endTime
​integer

结束时间(包含),Unix 毫秒时间戳,需 ≥ startTime 且不能晚于当前时间。

limit
​integer

返回的K线条数,范围 1-100,默认 100。

priceType
​string

价格类型:LAST(最新价)、INDEX(指数价)、MARK(标记价),默认 LAST。

获取历史K线 › 响应

200

成功响应

​array[]
array
index[0]
​integer

开盘时间Unix 毫秒时间戳

Example: 1763894400000
index[1]
​string

开盘价

Example: 68000.0
index[2]
​string

最高价

Example: 68550.0
index[3]
​string

最低价

Example: 67810.0
index[4]
​string

收盘价

Example: 68220.0
index[5]
​string

成交量(基础资产)

Example: 320.456
index[6]
​integer

收盘时间Unix 毫秒时间戳

Example: 1763908800000
index[7]
​string

成交额(计价资产)

Example: 21874563.70
index[8]
​integer

成交笔数

Example: 982
index[9]
​string

主动买入成交量(基础资产)

Example: 180.120
index[10]
​string

主动买入成交额(计价资产)

Example: 12345678.90

获取交易对价格

获取交易对价格。

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

获取交易对价格 › 查询参数

symbol
​string · required

交易对

priceType
​string

价格类型,可选:INDEX、MARK,默认 INDEX。

获取交易对价格 › 响应

200

成功响应

symbol
​string

交易对

price
​string

对应价格

time
​integer

系统时间戳Unix 毫秒时间戳


获取未平仓合约数

获取未平仓合约数。

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

获取未平仓合约数 › 查询参数

symbol
​string · required

交易对

获取未平仓合约数 › 响应

200

成功响应

symbol
​string

交易对

openInterest
​string

当前未平仓合约数量

time
​integer

撮合引擎时间戳Unix 毫秒时间戳


获取最新资金费率

获取最新资金费率。

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

获取最新资金费率 › 查询参数

symbol
​string

交易对,留空返回全部交易对的资金费率信息。

获取最新资金费率 › 响应

200

成功响应

​object[]
symbol
​string

交易对

markPrice
​string

最新标记价格

indexPrice
​string

最新指数价格

lastFundingRate
​string

最近一次资金费率

forecastFundingRate
​string

预测资金费率

interestRate
​string

标的资产基准利率

nextFundingTime
​integer

下一次资金费时间Unix 毫秒时间戳

time
​integer

数据时间戳Unix 毫秒时间戳

collectCycle
​integer

资金费率结算周期(分钟)


获取历史资金费率

获取历史资金费率。

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

获取历史资金费率 › 查询参数

symbol
​string · required

交易对

startTime
​integer

起始时间(包含),Unix 毫秒时间戳

endTime
​integer

结束时间(包含),Unix 毫秒时间戳,需 ≥ startTime

limit
​integer

返回条数,范围 1-1000,默认 100

获取历史资金费率 › 响应

200

成功响应

​object[]
symbol
​string

交易对

fundingRate
​string

历史资金费率

fundingTime
​integer

资金费时间Unix 毫秒时间戳

markPrice
​string

资金费发生时的标记价格


获取合约交易对

获取合约交易对。

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

获取合约交易对 › 响应

200

成功响应

​string[]

杠杆分层标准

杠杆分层标准。

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

杠杆分层标准 › 查询参数

symbol
​string

合约交易对,例如 BTCUSDT。不传时返回全部合约的风险档位。

杠杆分层标准 › 响应

200

成功响应

​object[]
symbol
​string

合约交易对

​object[]

杠杆分层列表,每个元素见 Bracket 对象。