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

# 交易時段

> 查詢指定市場的交易時段信息，包括開盤時間、收盤時間等。

## 注意事項

* 市場代碼不區分大小寫
* 返回的時間為各市場的**當地時間**

## 支持的市場

* **US** - 美國股票市場
* **HK** - 香港證券交易所
* **CN** - A股市場

## 請求參數

| 參數名    | 是否必須 | 描述                  |
| ------ | ---- | ------------------- |
| market | 是    | 市場代碼，可選值：US, HK, CN |

## 返回字段說明

| 字段                | 說明                                          |
| ----------------- | ------------------------------------------- |
| market            | 市場（US - 美股市場，HK - 港股市場，CN - A股市場）           |
| trading\_sessions | 交易時段數組                                      |
| └─ begin\_time    | 交易開始時間，格式：hhmm，例如：900                       |
| └─ end\_time      | 交易結束時間，格式：hhmm，例如：1400                      |
| └─ trade\_session | 交易時段類型（0 - 盤中交易，1 - 盤前交易，2 - 盤後交易，3 - 夜盤交易） |


## OpenAPI

````yaml GET /v1/market/trading-sessions
openapi: 3.0.0
info:
  title: TickDB API
  description: >-
    Unified real-time market data API — one connection for Forex, indices, US
    stocks, HK stocks, A-shares, and Crypto via REST and WebSocket.
  version: 1.0.1
  contact:
    email: support@tickdb.ai
servers:
  - url: https://api.tickdb.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v1/market/trading-sessions:
    get:
      summary: Trading Sessions
      description: Get trading session information for a specific market
      parameters:
        - name: market
          in: query
          required: true
          description: Market code (US, HK, CN)
          schema:
            type: string
            enum:
              - US
              - HK
              - CN
            default: US
            example: US
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 0
                  message:
                    type: string
                    example: success
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        market:
                          type: string
                        trading_sessions:
                          type: array
                          items:
                            type: object
                            properties:
                              begin_time:
                                type: integer
                              end_time:
                                type: integer
                              trade_session:
                                type: integer
                    example:
                      - market: US
                        trading_sessions:
                          - begin_time: 400
                            end_time: 930
                            trade_session: 1
                          - begin_time: 930
                            end_time: 1600
                          - begin_time: 1600
                            end_time: 2000
                            trade_session: 2
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````