> ## Documentation Index
> Fetch the complete documentation index at: https://alltick.co/apis/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch K-lines

### Endpoint description

Batch query multiple products and K-line types (such as 1-minute, 15-minute, or 30-minute bars) in one request. Only the latest two bars can be retrieved.

```http theme={null}
POST /v1/batch-kline
```

| Product type | Request URL |
| - | - |
| US stocks, Hong Kong stocks, A-shares, and major indices | `https://quote.alltick.co/quote-stock-b-api/v1/batch-kline` |
| Forex, precious metals, cryptocurrencies, crude oil, CFD indices, and commodities | `https://quote.alltick.co/quote-b-api/v1/batch-kline` |

### Request parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `X-API-Key` | string | Yes | Authentication token |
| `body` | string | Yes | Request content |

### body request content

```json theme={null}
{
  "trace": "c2a8a146-a647-4d6f-ac07-8c4805bf0b74",
  "data": {
    "symbol_list": [
      {
        "code": "700.HK",
        "kline_type": 1,
        "kline_timestamp_end": 0,
        "query_kline_num": 1,
        "adjust_type": 0
      },
      {
        "code": "GOOGL.US",
        "kline_type": 1,
        "kline_timestamp_end": 0,
        "query_kline_num": 1,
        "adjust_type": 0
      }
    ]
  }
}
```

| Name | Type | Required | Description |
| - | - | - | - |
| `trace` | string | Yes | Unique trace ID for locating logs; use a distinct value for each request |
| `data` | object | Yes | Request data |
| `symbol_list` | array | Yes | List of products and K-line conditions |
| `code` | string | Yes | Product code; case must match the product list |
| `kline_type` | integer | Yes | K-line type; 1–10 represent 1-minute through monthly bars |
| `kline_timestamp_end` | integer | Yes | 0 queries backward from the latest trading day |
| `query_kline_num` | integer | Yes | This endpoint retrieves at most two bars |
| `adjust_type` | integer | Yes | Stock adjustment type; only 0 is currently supported |

### Response example

```json theme={null}
{
  "ret": 200,
  "msg": "ok",
  "trace": "c2a8a146-a647-4d6f-ac07-8c4805bf0b74",
  "data": {
    "kline_list": [
      {
        "code": "700.HK",
        "kline_type": 1,
        "kline_data": [{"timestamp":"1677829200","open_price":"136.421","close_price":"136.412","high_price":"136.422","low_price":"136.407","volume":"0","turnover":"0"}]
      },
      {
        "code": "GOOGL.US",
        "kline_type": 1,
        "kline_data": [{"timestamp":"1677829200","open_price":"136.421","close_price":"136.412","high_price":"136.422","low_price":"136.407","volume":"0","turnover":"0"}]
      }
    ]
  }
}
```

### Response fields

The response contains `ret`, `msg`, `trace`, and `data.kline_list`. Each item includes `code`, `kline_type`, and `kline_data`; each bar has `timestamp`, `open_price`, `close_price`, `high_price`, `low_price`, `volume`, and `turnover`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.