> ## 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.

# 複数商品 K ライン

### インターフェース説明

複数商品と複数の K ライン種別（1 分足、15 分足、30 分足など）を一括照会できます。ただし、照会できるのは最新の 2 本までです。

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

| 商品種別                         | リクエスト URL                                                   |
| ---------------------------- | ----------------------------------------------------------- |
| 米国株、香港株、A 株、主要指数             | `https://quote.alltick.co/quote-stock-b-api/v1/batch-kline` |
| 外国為替、貴金属、暗号資産、原油、CFD 指数、商品先物 | `https://quote.alltick.co/quote-b-api/v1/batch-kline`       |

### リクエストパラメータ

| パラメータ       | 型      | 必須 | 説明      |
| ----------- | ------ | -- | ------- |
| `X-API-Key` | string | はい | 認証トークン  |
| `body`      | string | はい | リクエスト内容 |

### body リクエスト内容

```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
      }
    ]
  }
}
```

| 名前                    | 型       | 必須 | 説明                                |
| --------------------- | ------- | -- | --------------------------------- |
| `trace`               | string  | はい | ログ検索用の追跡 ID。リクエストごとに一意の値を指定してください |
| `data`                | object  | はい | リクエストデータ                          |
| `symbol_list`         | array   | はい | 商品と K ライン条件の一覧                    |
| `code`                | string  | はい | 商品コード。大文字・小文字は商品一覧と一致させてください      |
| `kline_type`          | integer | はい | K ライン種別。1～10 は 1 分足から月足までを表します    |
| `kline_timestamp_end` | integer | はい | 0 は最新の取引日から過去へ照会                  |
| `query_kline_num`     | integer | はい | このエンドポイントでは最大 2 本まで照会できます         |
| `adjust_type`         | integer | はい | 株式の株価調整種別。現在は 0 のみ対応              |

### レスポンス例

```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"}]
      }
    ]
  }
}
```

### レスポンスフィールド

レスポンスには `ret`、`msg`、`trace`、`data.kline_list` が含まれます。各項目には `code`、`kline_type`、`kline_data` があり、各足には `timestamp`、`open_price`、`close_price`、`high_price`、`low_price`、`volume`、`turnover` が含まれます。
