> For the complete documentation index, see [llms.txt](https://docs.infoway.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.infoway.io/rest-api/http-endpoints/get-depth.md).

# GET获取产品的实时买卖盘口(Depth)

获取股票、加密货币、外汇、能源、商品等所有产品的实时买卖盘口

## 接口说明

该接口是获取股票、加密货币、外汇、能源、商品等所有产品的实时买卖盘口

## 请求频率

跟其他接口请求频率使用同一个频率限制。具体每秒请求次数根据套餐决定。可以参考[接口限制说明](/getting-started/api-limitation.md)

## 错误码说明

参考HTTP错误码说明

## 接口地址

### 股票接口（包括美股、港股、A股）：

* 基本路径：`/stock/batch_depth/{codes}`
* 完整路径：`https://data.infoway.io/stock/batch_depth/{codes}`

### 日本股接口：

* 基本路径：`/japan/batch_depth/{codes}`
* 完整路径：`https://data.infoway.io/japan/batch_depth/{codes}`

### 印度股接口：

* 基本路径：`/india/batch_depth/{codes}`
* 完整路径：`https://data.infoway.io/india/batch_depth/{codes}`

### 韩国股接口：

* 基本路径：`/korea/batch_depth/{codes}`
* 完整路径：`https://data.infoway.io/korea/batch_depth/{codes}`

### 台湾股接口：

* 基本路径：`/taiwan/batch_depth/{codes}`
* 完整路径：`https://data.infoway.io/taiwan/batch_depth/{codes}`

### 加密货币接口：

* 基本路径：`/crypto/batch_depth/{codes}`
* 完整路径：`https://data.infoway.io/crypto/batch_depth/{codes}`

### 外汇、新能源、商品、贵金属、期货等产品接口：

* 基本路径：`/common/batch_depth/{codes}`
* 完整路径：`https://data.infoway.io/common/batch_depth/{codes}`

## 请求头

| 参数       | 类型     | 必填 | 描述           |
| -------- | ------ | -- | ------------ |
| `apiKey` | String | 是  | 您套餐中的API Key |

## 入参说明

| 参数名     | 类型     | 必填 | 描述                                      | 示例值               |
| ------- | ------ | -- | --------------------------------------- | ----------------- |
| `codes` | String | 是  | 查询的产品代码，多个之间用,分隔。可参考产品列表，最多支持100个产品一起查询 | `TSLA.US,AAPL.US` |

## 返回示例

```json
{
    "ret": 200,
    "msg": "success",
    "traceId": "81688452-dd7c-4de7-b423-b5e39d18e298",
    "data": [
        {
            "s": "01810.HK",
            "t": 1769760489943,
            "a": [
                [
                    "35.520",
                    "35.540",
                    "35.560",
                    "35.580",
                    "35.600",
                    "35.620",
                    "35.640",
                    "35.660",
                    "35.680",
                    "35.700"
                ],
                [
                    "3031600",
                    "134600",
                    "475600",
                    "754400",
                    "1225600",
                    "946800",
                    "1173800",
                    "689000",
                    "805200",
                    "2437200"
                ]
            ],
            "b": [
                [
                    "35.500",
                    "35.480",
                    "35.460",
                    "35.440",
                    "35.420",
                    "35.400",
                    "35.380",
                    "35.360",
                    "35.340",
                    "35.320"
                ],
                [
                    "433800",
                    "858400",
                    "784400",
                    "1018200",
                    "1118600",
                    "1969200",
                    "1167200",
                    "883200",
                    "1298400",
                    "420800"
                ]
            ]
        }
    ]
}
```

| 字段名 | 类型     | 必填 | 描述                              | 示例值                                          |
| --- | ------ | -- | ------------------------------- | -------------------------------------------- |
| `s` | String | 是  | 标的代码                            | `00285.HK`                                   |
| `t` | Long   | 是  | 盘口时间（Unix 毫秒时间戳）                | `1747382898892`                              |
| `a` | Array  | 是  | 卖盘：第一个数组为价格，第二个数组为挂单数量，同下标对应同一档 | `[["35.520","35.540"],["3031600","134600"]]` |
| `b` | Array  | 是  | 买盘：第一个数组为价格，第二个数组为挂单数量，同下标对应同一档 | `[["35.500","35.480"],["433800","858400"]]`  |

### 盘口数组的读取方式

`a[0][i]` 与 `a[1][i]` 分别是卖盘第 `i` 档的价格和挂单数量；`b[0][i]` 与 `b[1][i]` 是买盘对应档位。数组元素为字符串。档位数量以实际返回为准，本接口没有用于选择档位数量的请求参数。
