Bitget APIBitget API
统一账户经典账户
旧文档
  • 概览
  • API 文档
  • WebSocket
  • Agent Hub
  • SDK
  • 更新日志
Copied to clipboard
Websocket
介绍
合约
    公共频道
      行情频道K线频道深度频道平台成交详情频道
    私有频道
现货
杠杆
公共频道

K线频道

描述

订单K线频道

k线频道有成交,1s推送一次

没成交,到时间粒度时推送一次

Code
{ "op": "subscribe", "args": [ { "instType": "USDT-FUTURES", "channel": "candle1m", "instId": "BTCUSDT" } ] }

请求参数

参数名参数类型是否必须描述
opString是操作, subscribe unsubscribe
argsList<Object>是请求订阅的频道列表
> instTypeString是产品类型
USDT-FUTURES U本位合约
COIN-FUTURES 币本位合约
USDC-FUTURES USDC合约
> channelString是频道名,candle1m (1分钟) candle5m (5分钟) candle15m (15分钟) candle30m (30分钟) candle1H (1小时) candle4H (4小时) candle12H (12小时)
candle1D (1天) candle1W (1周) candle6H (6小时) candle3D (3天) candle1M (1月线) candle6Hutc (零时区 6小时线) candle12Hutc (零时区12小时线)
candle1Dutc (零时区 1日线) candle3Dutc (零时区 3日线) candle1Wutc (零时区 周线) candle1Mutc (零时区 月线)
> instIdString是产品ID
如:ETHUSDT
Code
{ "event": "subscribe", "arg": { "instType": "USDT-FUTURES", "channel": "candle1m", "instId": "BTCUSDT" } }

返回参数

返回字段参数类型字段说明
eventString事件
argObject订阅的频道
> channelString频道名,candle1m (1分钟) candle5m (5分钟) candle15m (15分钟) candle30m (30分钟) candle1H (1小时) candle4H (4小时) candle12H (12小时)
candle1D (1天) candle1W (1周) candle6H (6小时) candle3D (3天) candle1M (1月线) candle6Hutc (零时区 6小时线) candle12Hutc (零时区12小时线)
candle1Dutc (零时区 1日线) candle3Dutc (零时区 3日线) candle1Wutc (零时区 周线) candle1Mutc (零时区 月线)
> instTypeString产品类型
USDT-FUTURES U本位合约
COIN-FUTURES 币本位合约
USDC-FUTURES USDC合约
> instIdString产品ID, 如:ETHUSDT
codeString错误码
msgString错误消息
Code
{ "action": "snapshot", "arg": { "instType": "USDT-FUTURES", "channel": "candle1m", "instId": "BTCUSDT" }, "data": [ [ "1695685500000", "27000", "27000.5", "27000", "27000.5", "0.057", "1539.0155", "1539.0155" ] ], "ts": 1695715462250 }

推送数据参数

返回字段参数类型字段说明
actionString推送动作, snapshot or update
argObject订阅成功的频道
> channelString频道名
> instIdString产品ID, 如:ETHUSDT
> instTypeString产品类型
USDT-FUTURES U本位合约
COIN-FUTURES 币本位合约
USDC-FUTURES USDC合约
dataList<String>订阅的数据
> index[0]String开始时间,Unix时间戳的毫秒数格式,如 1597026383085
> index[1]String开盘价格
> index[2]String最高价格
> index[3]String最低价格
> index[4]String收盘价格
> index[5]String数值为左币交易量, 交易币成交量
> index[6]String计价币成交量
> index[7]String折合USDT量
tsString数据推送时间
行情频道深度频道
JSON
JSON
JSON