跳到主要内容

24小时价格行情 (Tickers)

获取指定交易对的24小时价格变化统计。

接口信息

  • Method: GET
  • Path: /api/v1/markets/:symbol/ticker
  • Authentication: 不需身份验证

路径参数

参数类型必须描述
symbolstring交易对名称(如 BTCUSDT)

响应示例

{
"symbol": "BTCUSDT",
"last_price": "65000.00",
"price_change_24h": "500.00",
"price_change_percent_24h": "0.77",
"high_24h": "66000.00",
"low_24h": "64000.00",
"volume_24h": "1200.5",
"open_interest": "5000.0",
"funding_rate": "0.0001",
"next_funding_time": 1704096000
}

响应字段说明

字段类型描述
symbolstring交易对名称
last_pricestring最新成交价
price_change_24hstring24小时价格变化
price_change_percent_24hstring24小时价格变化百分比
high_24hstring24小时最高价
low_24hstring24小时最低价
volume_24hstring24小时成交量
open_intereststring持仓量
funding_ratestring当前资金费率
next_funding_timenumber下次资金费率结算时间(Unix 时间戳)

说明

  • 数据来源于 OKX 交易所实时行情
  • 所有价格和数量字段均为字符串格式以保证精度
  • 资金费率每8小时结算一次

获取实时价格

接口信息

  • Method: GET
  • Path: /api/v1/markets/:symbol/price
  • Authentication: 不需身份验证

路径参数

参数类型必须描述
symbolstring交易对名称(如 BTCUSDT)

响应示例

{
"symbol": "BTCUSDT",
"mark_price": "65000.00",
"index_price": "64995.00",
"last_price": "65000.00",
"bid_price": "64999.50",
"ask_price": "65000.50",
"funding_rate": "0.0001",
"next_funding_rate": "0.00012",
"next_funding_time": 1704096000,
"updated_at": 1704067200000
}

响应字段说明

字段类型描述
symbolstring交易对名称
mark_pricestring标记价格(用于清算计算)
index_pricestring指数价格
last_pricestring最新成交价
bid_pricestring最佳买价
ask_pricestring最佳卖价
funding_ratestring当前资金费率
next_funding_ratestring预测下次资金费率
next_funding_timenumber下次资金费率结算时间(Unix 时间戳,毫秒)
updated_atnumber更新时间(Unix 时间戳,毫秒)

错误响应

HTTP 状态码错误码描述
404INVALID_MARKET未知的交易对
503PRICE_DATA_UNAVAILABLE价格数据暂时不可用