# Depth Channel

### Description

This is the channel to get the depth data<br/>Default data push frequency for `books`, `books5`, `books15` is **200ms**<br/>Default data push frequency for `books1` is **10ms**

- `books`: All levels of depth. First update pushed is full data: `snapshot`, and then push the update data: `update`
- `books1`: 1st level of depth. Push `snapshot` each time
- `books5`: 5 depth levels. Push `snapshot` each time
- `books15`: 15 depth levels. Push `snapshot` each time

**Explanation of seq**
- The seq of update incremental messages is incrementing except during symbol maintenance.

<div className="api-br-5"></div>

<div className="api-aligning">

```json title="Request Example"
{
    "op": "subscribe",
    "args": [
        {
            "instType": "SPOT",
            "channel": "books5",
            "instId": "BTCUSDT"
        }
    ]
}
```

### Request Parameters

| Parameter | Type | Required | Description | 
| :---- | :---- | :---- | :---- |
| op | String | Yes | Operation, subscribe unsubscribe |
| args | List&lt;Object&gt; | Yes | List of channels to request subscription |
| &gt; instType | String | Yes | Product line type |
| &gt; channel | String | Yes | Channel name: `books/books1/books5/books15`   |
| &gt; instId | String | Yes | Product ID, e.g. ETHUSDT |

</div>

<div className="api-br-10"></div>

<div className="api-aligning">

```json title="Response Example"
{
  "event": "subscribe",
  "arg": {
    "instType": "SPOT",
    "channel": "books5",
    "instId": "BTCUSDT"
  }
}
```

### Response Parameters

| Parameter | Type | Description | 
| :---- | :---- | :---- |
| event | String | Yes<br/>Event |
| arg | Object | Subscribed channels |
| &gt; instType | String | Product type |
| &gt; channel | String | Channel name: `books/books1/books5/books15` |
| &gt; instId | String | Product ID, e.g. ETHUSDT |
| code | String | Error code, returned only on error |
| msg | String | Error message |

</div>

<div className="api-br-10"></div>

<div className="api-aligning">

```json title="Push Data"
{
  "action": "snapshot",
  "arg": {
    "instType": "SPOT",
    "channel": "books5",
    "instId": "BTCUSDT"
  },
  "data": [
    {
      "asks": [
        [
          "26274.9",
          "0.0009"
        ],
        [
          "26275.0",
          "0.0500"
        ]
      ],
      "bids": [
        [
          "26274.8",
          "0.0009"
        ],
        [
          "26274.7",
          "0.0027"
        ]
      ],
      "seq": 123,
      "ts": "1695710946294"
    }
  ],
  "ts": 1695710946294
}
```

### Push Parameters

| Parameter     | Type               | Description                                                                                                                                         | 
|:--------------|:-------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------|
| arg           | Object             | Channels with successful subscription                                                                                                               |
| &gt; instType | String             | Product type                                                                                                                                        |
| &gt; channel  | String             | Channel name: `books/books1/books5/books15`                                                                                                         |
| &gt; instId   | String             | Product ID, e.g. ETHUSDT                                                                                                                            |
| action        | String             | Push data action, `snapshot` or `update`                                                                                                            |
| data          | List&lt;Object&gt; | Subscription data                                                                                                                                   |
| &gt; instId   | String             | Product ID, e.g. ETHUSDT                                                                                                                            |
| &gt; asks     | List&lt;String&gt; | Seller depth                                                                                                                                        |
| &gt; bids     | List&lt;String&gt; | Buyer depth                                                                                                                                         |
| &gt; ts       | String             | Matching engine timestamp(ms), e.g. 1597026383085                                                                                                   |
| &gt; seq      | Long               | Serial number.<br/>It increases when the order book is updated and can be used to determine whether there is out-of-order packets.                  |

</div>
