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

# 交易日历

> 查询指定市场在特定时间范围内的交易日列表，用于判断某日是否为交易日。

## 注意事项

* 日期格式必须为 YYYYMMDD（如：20260201）
* 返回的交易日不包括周末和节假日
* 市场代码不区分大小写

## 支持的市场

* **US** - 美国股票市场
* **HK** - 香港证券交易所
* **CN** - A股市场

## 请求参数

| 参数名      | 是否必须 | 描述                  |
| -------- | ---- | ------------------- |
| market   | 是    | 市场代码，可选值：US, HK, CN |
| beg\_day | 是    | 开始日期，格式：YYYYMMDD    |
| end\_day | 是    | 结束日期，格式：YYYYMMDD    |

## 返回字段说明

| 字段                | 说明                            |
| ----------------- | ----------------------------- |
| market            | 市场代码                          |
| trade\_days       | 全日交易日列表，使用 YYYYMMDD 格式        |
| half\_trade\_days | 半日交易日列表（仅半天交易），使用 YYYYMMDD 格式 |


## OpenAPI

````yaml GET /v1/market/trade-days
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/trade-days:
    get:
      summary: Trading Days
      description: Get trading days for a specific market within a date range
      parameters:
        - name: market
          in: query
          required: true
          description: Market code (US, HK, CN)
          schema:
            type: string
            enum:
              - US
              - HK
              - CN
            default: US
            example: US
        - name: beg_day
          in: query
          required: true
          description: Start date (format YYYYMMDD)
          schema:
            type: string
            default: '20260201'
            example: '20260201'
        - name: end_day
          in: query
          required: true
          description: End date (format YYYYMMDD)
          schema:
            type: string
            default: '20260228'
            example: '20260228'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 0
                  message:
                    type: string
                    example: success
                  data:
                    type: object
                    properties:
                      market:
                        type: string
                      trade_days:
                        type: array
                        items:
                          type: string
                      half_trade_days:
                        type: array
                        items:
                          type: string
                    example:
                      market: US
                      trade_days:
                        - '20260202'
                        - '20260203'
                        - '20260204'
                        - '20260205'
                        - '20260206'
                        - '20260209'
                        - '20260210'
                        - '20260211'
                        - '20260212'
                        - '20260213'
                        - '20260217'
                        - '20260218'
                        - '20260219'
                        - '20260220'
                        - '20260223'
                        - '20260224'
                        - '20260225'
                        - '20260226'
                        - '20260227'
                      half_trade_days: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````