> 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/en-docs/rest-api/market-data/get-market-depth.md).

# GET Market Depth

### Overview

The **Market Depth API** provides the latest buy and sell order information (market depth) for various financial instructments, including stocks, cryptocurrencies, forex, energy, commodities, and more. This API allows users to retrieve live buy and sell orders for a specified list of symbols.

### Endpoint

<table><thead><tr><th width="179.77777099609375">Market</th><th>Endpoint</th></tr></thead><tbody><tr><td>Stocks</td><td><code>https://data.infoway.io/stock/batch_depth/{codes}</code></td></tr><tr><td>Crypto</td><td><code>https://data.infoway.io/crypto/batch_depth/{codes}</code></td></tr><tr><td>Japan</td><td><code>https://data.infoway.io/japan/batch_depth/{codes}</code></td></tr><tr><td>India</td><td><code>https://data.infoway.io/india/batch_depth/{codes}</code></td></tr><tr><td>Korea</td><td><code>https://data.infoway.io/korea/batch_depth/{codes}</code></td></tr><tr><td>Taiwan</td><td><code>https://data.infoway.io/taiwan/batch_depth/{codes}</code></td></tr><tr><td>Forex, Commodities, Futures</td><td><code>https://data.infoway.io/common/batch_depth/{codes}</code></td></tr></tbody></table>

### Request Frequency

This API shares the same rate limits as other endpoints. The number of allowed requests per second depends on your subscription plan. Please refer to the **Rate Limit Policy** for details.

### Error Codes

See the HTTP Error Codes section for reference.

### Authentication

Each request must include your **API Key** in the header.

| **Header** | **Type** | **Required** | **Description**                                 |
| ---------- | -------- | ------------ | ----------------------------------------------- |
| `apiKey`   | String   | Yes          | Your API Key associated with your current plan. |

### Request Parameters

| **Parameter** | **Type** | **Required** | **Description**                                                           | **Example**       |
| ------------- | -------- | ------------ | ------------------------------------------------------------------------- | ----------------- |
| `codes`       | String   | Yes          | Comma-separated list of product codes to query.(Up to 100 symbol at once) | `TSLA.US,AAPL.US` |

### Example Response

```json
{
  "ret": 200,
  "msg": "success",
  "traceId": "972c7bdd-a151-4a13-b4a1-a24a30c65783",
  "data": [
    {
      "s": "00285.HK",
      "t": 1747382976831,
      "a": [
        ["34.650","34.700","34.750","34.800","34.850","34.900","34.950","35.000","35.050","35.100"],
        ["44000","44500","225500","124000","147500","135500","65000","111000","39500","124500"]
      ],
      "b": [
        ["34.600","34.550","34.500","34.450","34.400","34.350","34.300","34.250","34.200","34.150"],
        ["109500","39500","130500","89000","144000","246500","231500","83000","224000","22000"]
      ]
    },
    {
      "s": "002594.SZ",
      "t": 1747378802012,
      "a": [
        ["389.17","389.45","389.50","389.57","389.69"],
        ["60","6","1","1","8"]
      ],
      "b": [
        ["389.16","389.09","389.05","389.02","389.01"],
        ["6","1","1","1","10"]
      ]
    }
  ]
}
```

### Response Fields

| **Field** | **Type** | **Required** | **Description**                                                                                                            | **Example / Values**                          |
| --------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| `s`       | String   | Yes          | The product code or symbol.                                                                                                | `00285.HK`                                    |
| `t`       | Long     | Yes          | The depth timestamp in Unix milliseconds.                                                                                  | `1747382898892`                               |
| `a`       | Array    | Yes          | The sell orders array: prices in the first sub-array, order sizes in the second. Matching indices identify the same level. | `[["34.650", "34.700"], ["44000", "44500"]]`  |
| `b`       | Array    | Yes          | The buy orders array: prices in the first sub-array, order sizes in the second. Matching indices identify the same level.  | `[["34.600", "34.550"], ["109500", "39500"]]` |

### Notes

* The `a` field represents the sell orders (ask side) and contains two sub-arrays: the first for prices and the second for volumes.
* The `b` field represents the buy orders (bid side), with the same structure as the sell orders.
* This API is useful for tracking real-time market depth to make informed trading decisions.

`a[0][i]` and `a[1][i]` are the ask price and order size at level `i`; `b[0][i]` and `b[1][i]` give the matching bid fields. Array elements are strings. The number of levels depends on the returned data; this endpoint has no request parameter for selecting a depth level count.
