Skip to content

Ticker

Spot WebSocket Ticker

Subscribe

Request Format

{
  "op":"subscribe",
  "args":[
    "<topic 1>",
    "<topic 2>",
    "...",
    "<topic n>"
  ]
}

Topic Description

  • Topic format: "spot/ticker.{instrument_id}"
Name Type Mandatory Description
instrument_id string YES contract abbreviation, such as BTCUSDT. If this value is "all", you will get the ticker information of all contracts.

Request Example

{
  "op": "subscribe",
  "args": [
    "spot/ticker.BTCUSDT",
    "spot/ticker.all"
  ]
}

Response Example

{
  "topic": "spot/ticker.BTCUSDT",
  "action": "insert",// At the first time , action = insert, then ,without this feild, means appended data.
  "data": [
    {
      "symbol": "BTCUSDT",
      "lastPrice": "29470.71",
      "bestAskPrice": "29470.72",
      "bestBidPrice": "29470.70",
      "high24h": "30040.39",
      "open24h": "30019.36",
      "openPrice": "29429.82",
      "low24h": "29120.75",
      "volume24h": "119190711.0511",
      "timestamp": 1681785917006
    }
  ]
}

Unsubscribe

Request Format

{
  "op":"unsubscribe",
  "args":[
    "<topic 1>",
    "<topic 2>",
    "...",
    "<topic n>"
  ]
}

Topic Description

  • Topic format: "spot/ticker.{instrument_id}"
Name Type Mandatory Description
instrument_id string YES contract abbreviation, such as BTCUSDT. If this value is "all", you will get the ticker information of all contracts.

Request Example

{
    "op": "unsubscribe",
    "args": [
        "spot/ticker.BTC-SWAP",
        "spot/ticker.all"
    ]
}