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

````