{
  "openapi": "3.1.0",
  "info": {
    "title": "A股数据 API",
    "description": "多源数据通道（自动切换） · 行情/财务/资金/选股/宏观/可转债/ETF",
    "version": "0.1.0"
  },
  "paths": {
    "/v1/health": {
      "get": {
        "tags": [
          "free"
        ],
        "summary": "服务健康检查",
        "description": "检查服务状态与数据通道是否可用（data_ready=true 表示能正常取数）。数据通道状态随时可查",
        "operationId": "health_v1_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/challenge": {
      "get": {
        "tags": [
          "free"
        ],
        "summary": "获取 PoW 挑战（匿名提额用）",
        "description": "匿名请求超限（429）时也会直接返回同一份挑战。解出 nonce 后带 `X-PoW: <challenge>.<nonce>` 请求，匿名配额从 5 次/分提升到 15 次/分。⚠️ 只提升**每分钟次数**，**不提升每日条数**（匿名每日最多取 10 万条）。付费 Key 用户无需使用。",
        "operationId": "challenge_v1_challenge_get",
        "parameters": [
          {
            "name": "difficulty",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 24,
              "minimum": 0,
              "description": "自定义难度（前导 0 位数），0=服务端默认",
              "default": 0,
              "title": "Difficulty"
            },
            "description": "自定义难度（前导 0 位数），0=服务端默认"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quote": {
      "get": {
        "tags": [
          "free"
        ],
        "summary": "实时行情快照",
        "description": "A股/港股/美股实时行情（**轻量 8 字段**）：现价、开高低、成交量、成交额、换手率。用户问『某股票现在多少钱/什么价/现价』时用这个。⚠️ 数据为**当日盘中滚动更新**（约每分钟刷新）；取现价用 `data[0]`。⚠️ **免费 / 匿名档按 5 分钟刷新**（保障服务稳定性）；**付费档实时**（每次取此刻最新）。⚠️ `data` 是**数组**（默认 30 条日线，`data[0]` 为最新）。⚠️ 换手率的字段名是 **`turnover`**（单位 %）—— 与 /v1/snapshot **同名同值**（sz000001 两者均 0.54）。⚠️ **2026-09-26 改名**：该字段此前叫 `exchange`（上游历史命名，**极易被误读为「交易所」**）—— 已统一为 `turnover`；如需兼容旧代码，读 `turnover` 即可。⚠️ **不含**估值 / 市值 —— 要这些字段用 /v1/snapshot（35 字段，pro 档，仅 A 股）。⚠️ **`code` 支持逗号批量**（多标的）—— 但**匿名单次最多 5 只标的**（付费不限）。",
        "operationId": "quote_v1_quote_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "股票代码，带市场前缀：sh600667（沪）/ sz000001（深）/ hk00700（港）/ usAAPL（美）。**支持逗号批量**（多标的），但匿名单次最多 5 只",
              "title": "Code"
            },
            "description": "股票代码，带市场前缀：sh600667（沪）/ sz000001（深）/ hk00700（港）/ usAAPL（美）。**支持逗号批量**（多标的），但匿名单次最多 5 只"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/kline": {
      "get": {
        "tags": [
          "free"
        ],
        "summary": "K线（分钟/日/周/月/季/年）",
        "description": "历史 K 线数据。用户问『走势/最近表现/历史K线/趋势/分时』时用这个。**周期**：`day` 日线（默认）/ `week` 周线 / `month` 月线 / `season` 季线 / `year` 年线 / `m1` `m5` `m15` `m30` `m60` `m120` 分钟线。**日期范围**：`start` + `end`（`YYYY-MM-DD`），仅 `day` 与分钟线支持（周/月/季/年线用 `count` 取条数，1212 条已覆盖 20+ 年月线；**港股 / 美股 / 期货 / 外汇不支持日期范围**，请用 `count` 取最近 N 条）。⚠️ 换手率字段名是 **`turnover`**（单位 %）—— 与 /v1/quote、/v1/snapshot **同名同值**（2026-09-26 由 `exchange` 改名）。⚠️ 价格口径**固定为前复权**（除权除息日不跳空；无 `adjust` 参数）—— **不要再自己复权**（会二次复权）。分钟线**不复权**（上游对分钟级数据固定给原始价）。⚠️ 分钟线覆盖**近 1 个月**（窗口起点约为上个自然月月初；港股 / 美股窗口更短，实测只覆盖最近几个交易日），超范围返回空结果。⚠️ **分钟线需 `standard`（¥29.9）及以上档位**；日 / 周 / 月 / 季 / 年线免费（**免费 / 匿名档按 5 分钟刷新**；**付费档实时**）。⚠️ **`code` 支持逗号批量**（一次取多只，如 `code=sh600000,sz000001`）—— 但 **匿名单次最多 5 只标的**（付费不限）；且**单次预估总条数**（标的数 × `count`）**上限 6 万条**（防单请求过大，正常用户撞不到）。⚠️ **标的边界**：分钟线支持 A股 / 指数 / 板块 / ETF / 可转债 / 港股 / 美股（北交所 / 期货 / 外汇 / 美股指数无分钟线）；美股指数 `us.DJI` / `us.IXIC` / `us.SPX` 仅支持 day；期货 / 外汇只有 day / week / month（无季 / 年线）。⚠️ 字段固定 8 列（`date` `open` `last` `high` `low` `volume` `amount` `turnover`）—— 不随周期/范围变化。",
        "operationId": "kline_v1_kline_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "股票代码：sh600667；同样支持 指数 sh000001 / 板块 pt01801081 / ETF sh510300 / 港股 hk00700 / 美股 usAAPL / 可转债 sz128136 / 期货 fuCN / 外汇 fxCNH。**支持逗号批量**（多标的），但匿名单次最多 5 只",
              "title": "Code"
            },
            "description": "股票代码：sh600667；同样支持 指数 sh000001 / 板块 pt01801081 / ETF sh510300 / 港股 hk00700 / 美股 usAAPL / 可转债 sz128136 / 期货 fuCN / 外汇 fxCNH。**支持逗号批量**（多标的），但匿名单次最多 5 只"
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "周期：day 日线（默认）/ week 周线 / month 月线 / season 季线 / year 年线 / m1 m5 m15 m30 m60 m120 分钟线",
              "default": "day",
              "title": "Period"
            },
            "description": "周期：day 日线（默认）/ week 周线 / month 月线 / season 季线 / year 年线 / m1 m5 m15 m30 m60 m120 分钟线"
          },
          {
            "name": "count",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 1212,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "返回条数上限。不带 start/end 时默认 30；带 start/end 时默认取满区间（1212）。最大 1212（免 Key 匿名最多 250；分钟线需 Key）。⚠️ 多标的时**总条数（标的数 × count）上限 6 万**",
              "title": "Count"
            },
            "description": "返回条数上限。不带 start/end 时默认 30；带 start/end 时默认取满区间（1212）。最大 1212（免 Key 匿名最多 250；分钟线需 Key）。⚠️ 多标的时**总条数（标的数 × count）上限 6 万**"
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "起始日期 YYYY-MM-DD（仅 day 与分钟线；须与 end 配对；港股/美股/期货/外汇不支持）",
              "default": "",
              "title": "Start"
            },
            "description": "起始日期 YYYY-MM-DD（仅 day 与分钟线；须与 end 配对；港股/美股/期货/外汇不支持）"
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "结束日期 YYYY-MM-DD（仅 day 与分钟线；须与 start 配对；港股/美股/期货/外汇不支持）",
              "default": "",
              "title": "End"
            },
            "description": "结束日期 YYYY-MM-DD（仅 day 与分钟线；须与 start 配对；港股/美股/期货/外汇不支持）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/kline-full": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "全历史 K线（10 年日线 · 原始价 + 复权因子）",
        "description": "⭐ **A股全历史日线**（一次拿到**全部日线**，不受上游单次条数限制）（实测约 2465 根，而 `/v1/kline` 上限 1212 根）。适合：**长周期回测 / 因子研究 / 复权精确计算**。\n\n**标的范围（重要）**：仅 **A 股股票**（`sh` / `sz` / `bj` 前缀，共 5572 只）。⛔ **ETF / 可转债 / 指数 / 板块 / 港股 / 美股 / 期货 / 外汇均不支持** —— 这些标的请用 `/v1/kline`（覆盖全标的，上限 1212 根）。\n\n**`fq` 复权口径（本端点的核心价值）**：\n- `qfq`（默认）前复权：以最新价为基准，适合看走势\n- `hfq` 后复权：以最早价为基准，**适合回测**（历史值不随未来分红变化）\n- `nofq` **不复权原始价**：配合 `/v1/kline-full?fq=nofq` 取到的原始价，回测时**自算复权**（避免厂商前复权序列被未来事件改写）\n\n⚠️ **与 `/v1/kline` 的口径差异（务必看清）**：\n| | `/v1/kline` | 本端点 |\n|---|---|---|\n| 上限 | 1212 根 | **约 2465 根**（全历史 · 2016-08-08 起实测）|\n| 复权 | **写死前复权**（无参数）| **`fq` 可选** qfq/hfq/nofq |\n| 标的 | 全标的 | **仅 A 股股票** |\n\n⚠️ 数据范围：**2016-08-08 起**（数据边界，非上市日）。⚠️ 字段固定 7 列：`time` `open` `high` `low` `close` `volume` `amount`（⛔ 无 `turnover` 换手率 —— 上游日线口径无此列）。⚠️ 属**付费层**（需 API Key）—— 门槛为 **`standard`（¥29.9）及以上**，`trial`（¥9.9）不可用。",
        "operationId": "kline_full_v1_kline_full_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "A股代码：sh600519 / sz000001 / bj920047（⛔ 不支持 ETF/可转债/指数/板块/港股/美股）",
              "title": "Code"
            },
            "description": "A股代码：sh600519 / sz000001 / bj920047（⛔ 不支持 ETF/可转债/指数/板块/港股/美股）"
          },
          {
            "name": "fq",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "复权：qfq 前复权（默认）/ hfq 后复权 / nofq 不复权原始价",
              "default": "qfq",
              "title": "Fq"
            },
            "description": "复权：qfq 前复权（默认）/ hfq 后复权 / nofq 不复权原始价"
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "起始日期 YYYY-MM-DD（省略 = 从库起点 2016-08-08）",
              "default": "",
              "title": "Start"
            },
            "description": "起始日期 YYYY-MM-DD（省略 = 从库起点 2016-08-08）"
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "结束日期 YYYY-MM-DD（省略 = 到最新交易日）",
              "default": "",
              "title": "End"
            },
            "description": "结束日期 YYYY-MM-DD（省略 = 到最新交易日）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/market-kline": {
      "get": {
        "summary": "全市场单日 K 线（一次拿全 A 股某日行情）",
        "description": "**一次请求返回全市场（5000+ 只 A 股）在某一交易日的日线** —— 适合「每日增量更新全市场」，替代逐只调用（省 5000+ 次请求）。\n\n典型用法：每天收盘后调一次，取当日全市场 K 线入库。\n```\nGET /v1/market-kline?date=2026-09-30\n```\n\n⚠️ **两种限定（务必看清）**：\n| | 说明 |\n|---|---|\n| 档位 | **仅 `pro`（¥99）与 `unlimited`（¥199）** —— `standard` 及以下不可用 |\n| 计费 | **1 次调用 = 折算 500 次额度**（一次动 5000+ 只，量级远超单只接口）|\n\n⚠️ 日额度：`pro` 200 次/日 · `unlimited` 1000 次/日（另计，见重型额度）。\n⚠️ 字段固定 7 列：`code` `time` `open` `high` `low` `close` `volume` `amount`（**不复权原始价**）。\n⚠️ 数据范围：**2016-08-08 起**、**仅 A 股股票**（5572 只）—— 不含 ETF / 可转债 / 指数 / 板块 / 港股 / 美股。数据由官方 dump 每日增量维护，**最新可到前一交易日**（当日盘中数据不可用）。\n⚠️ 体积：单日全市场约 **785 KB**（实测 5560 只）。",
        "operationId": "market_kline_v1_market_kline_get",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "交易日 YYYY-MM-DD（如 2026-09-30；⛔ 非交易日返回空）",
              "title": "Date"
            },
            "description": "交易日 YYYY-MM-DD（如 2026-09-30；⛔ 非交易日返回空）"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "分页：每次最多返回 N 只（0 = 全部 5000+ 只）",
              "default": 0,
              "title": "Limit"
            },
            "description": "分页：每次最多返回 N 只（0 = 全部 5000+ 只）"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "分页偏移（配合 limit 使用）",
              "default": 0,
              "title": "Offset"
            },
            "description": "分页偏移（配合 limit 使用）"
          },
          {
            "name": "codes",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "可选：只取指定股票，逗号分隔（如 sh600519,sz000001；省略 = 全市场）",
              "default": "",
              "title": "Codes"
            },
            "description": "可选：只取指定股票，逗号分隔（如 sh600519,sz000001；省略 = 全市场）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/backtest": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "量化回测（策略回测 · 单标的实时 / 组合预计算）",
        "description": "⭐ **量化回测**：对给定标的或组合，按内置策略跑历史回测，返回收益/风险指标（可选净值曲线）。\n\n**两种模式**（用 `mode` 区分）：\n- `mode=single`（默认）：**单标的择时**回测，**实时计算**（毫秒级）。传 `code` + `strategy`。\n- `mode=portfolio`：**组合回测**（多标的选股），传 `strategy`。\n  ⚠️ 结果按**预置区间**返回（现有 4 个：全周期 / 近 4 年 / 近 2 年 / 前半段）；**省略 `start`/`end` = 全周期**（起点最早、终点最新）。传其他区间会返回此刻可用的区间清单（见响应 `available_ranges`）。\n  ⭐ 可选 `weighting` 指定**权重方案**：`equal`（默认·等权）/ `inv_vol`（**波动率倒数** —— 波动小的多配、大的少配，属 **Unlimited** 档能力）。\n\n**`strategy` 取值**（单标的 20 条）：`buy_hold` `low_vol` `dca` `vol_target` `ma_stop` `ma_cross` `grid` `mom20` `turtle` `rev5` `breakout` `atr_stop` `macd` `rsi` `boll` `kdj` `wr` `obv` `cci` `sar`\n（组合 9 条）：`buy_hold_equal` `lowvol20` `mom20` `mom20_ex_st` `rev5` `ma_cross` `volume_breakout` `smallcap` `largecap`\n\n⚠️ **成本已计入**：佣金（万三，最低 5 元）/ 印花税（卖出 0.05%）/ 过户费（沪市）/ 滑点（千一）。\n⚠️ **已计入约束**：涨跌停（不可成交则顺延）/ 停牌（缺行情即不成交）。\n⚠️ **ST 按当前名单**近似（历史逐日 ST 状态无公开源）——ST 股占全市场约 3.6%，影响局限在触及板限时。\n⚠️ **未计入**：冲击成本、容量约束。\n\n⚠️ 属**付费层**（需 API Key）—— 门槛 **`standard`（¥29.9）及以上**。\n⚠️ **日额度**：`standard` 30 次 / 日 · `pro` 300 次 / 日 · `unlimited` 1000 次 / 日。\n⚠️ **历史回测结果不代表未来表现**，仅供研究，不构成投资建议。",
        "operationId": "backtest_v1_backtest_get",
        "parameters": [
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "single=单标的实时 / portfolio=组合（查预计算）",
              "default": "single",
              "title": "Mode"
            },
            "description": "single=单标的实时 / portfolio=组合（查预计算）"
          },
          {
            "name": "strategy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "内置策略名（见描述）",
              "default": "buy_hold",
              "title": "Strategy"
            },
            "description": "内置策略名（见描述）"
          },
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "mode=single 时必填：A股代码 sh600519",
              "default": "",
              "title": "Code"
            },
            "description": "mode=single 时必填：A股代码 sh600519"
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "回测起始日 YYYY-MM-DD（mode=portfolio 时须为预置区间之一）",
              "default": "2019-01-01",
              "title": "Start"
            },
            "description": "回测起始日 YYYY-MM-DD（mode=portfolio 时须为预置区间之一）"
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "回测结束日 YYYY-MM-DD（省略=最新）",
              "default": "",
              "title": "End"
            },
            "description": "回测结束日 YYYY-MM-DD（省略=最新）"
          },
          {
            "name": "initial_cash",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "description": "初始资金（默认 100 万）",
              "default": 1000000,
              "title": "Initial Cash"
            },
            "description": "初始资金（默认 100 万）"
          },
          {
            "name": "weighting",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "mode=portfolio 权重方案：equal=等权 / inv_vol=波动率倒数（不限量版）",
              "default": "equal",
              "title": "Weighting"
            },
            "description": "mode=portfolio 权重方案：equal=等权 / inv_vol=波动率倒数（不限量版）"
          },
          {
            "name": "include_equity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "是否返回净值曲线",
              "default": false,
              "title": "Include Equity"
            },
            "description": "是否返回净值曲线"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/strategies": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "量化策略清单（单标的 20 + 组合 9 · 含实测表现）",
        "description": "⭐ **量化策略清单**：列出我们内置的全部策略（单标的择时 + 组合选股），含每个策略的**参数白名单**（名称/类型/最小/最大/默认）。\n\n⭐ **每个策略附「实测表现」**（`performance` 字段）——在 **800 只（沪深300+中证500）· 2019 年至今** 上跑出的真实成绩，**含真实交易成本**（佣金/印花税/滑点）。\n`verdict` 分级：`effective` 实测有效 / `neutral` 一般 / `weak` 偏弱 / **`avoid` 实测亏损** —— ⚠️ **无效的策略同样列出**，便于避开常见陷阱（如高换手策略被成本吃光）。\n⚠️ **历史实测不代表未来表现**，仅供研究，不构成投资建议。\n\n⚠️ 本端点是**静态清单**（不含重型额度）—— 与 `/v1/backtest`的**重型日额度相互独立**，查清单不消耗回测额度。\n⚠️ 属**付费层**（需 API Key）—— 门槛 **`standard`（¥29.9）及以上**。",
        "operationId": "strategies_v1_strategies_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/ip-whitelist": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "查 IP 白名单（Unlimited）",
        "description": "查当前 Key 的 **IP 白名单** —— 只有名单内的 IP 能调这个 Key。\n\n**它解决什么**：Key 泄漏（发群里 / 被扒 / 员工拷走）后，**别人拿到也用不了**；企业还能证明「数据只从我们机房出」。\n\n⚠️ **与「IP 数量上限」不同**：前者限的是「最多几个 IP」，本功能限的是「哪几个 IP」。\n⚠️ **空列表 = 未启用**（不加任何限制）。\n⚠️ 属 **Unlimited（¥199）** 档能力。",
        "operationId": "ip_whitelist_get_v1_ip_whitelist_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "pro"
        ],
        "summary": "设置 IP 白名单（覆盖式）",
        "description": "设置当前 Key 的 IP 白名单（**整体替换**旧列表）。\n\n**参数**：`ips` —— IP 列表（最多 50 个，仅支持**精确 IPv4/IPv6**，⛔ 不支持网段）。\n\n⚠️ 传空 = 清空（等价 `DELETE`，但**建议用 DELETE** 表达清除意图）。\n⚠️ **换网络时请把新旧 IP 一起传**（如 `1.2.3.4,5.6.7.8`），⛔ 只传新 IP 会让旧 IP 立刻失效。\n⚠️ 设置后**只能从名单内的 IP 再调用本端点**。\n⚠️ 属 **Unlimited（¥199）** 档能力。",
        "operationId": "ip_whitelist_set_v1_ip_whitelist_post",
        "parameters": [
          {
            "name": "ips",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "逗号分隔的 IP 列表，如 1.2.3.4,5.6.7.8",
              "default": "",
              "title": "Ips"
            },
            "description": "逗号分隔的 IP 列表，如 1.2.3.4,5.6.7.8"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "pro"
        ],
        "summary": "清空 IP 白名单（恢复任意 IP）",
        "description": "⭐ **清空白名单** ⇒ 该 Key 恢复「任意 IP 可用」。\n\n⚠️ 与查/设一样**必须从名单内的 IP 调用**（否则等于给攻击者留后门）。\n⚠️ 换网络被锁死请联系客服（管理员通道解除）。\n⚠️ 属 **Unlimited（¥199）** 档能力。",
        "operationId": "ip_whitelist_clear_v1_ip_whitelist_delete",
        "parameters": [
          {
            "name": "target_key",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "仅客服使用：要清除的目标 Key",
              "default": "",
              "title": "Target Key"
            },
            "description": "仅客服使用：要清除的目标 Key"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/backtest-batch": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "批量回测（多标的 × 多策略对比）",
        "description": "⭐ **批量回测**：一次跑**多只标的 × 多个策略**，返回对比矩阵（谁表现最好）。\n\n**与 `/v1/backtest` 的关系**：单次模式跑「1 票 × 1 策略」；本端点跑「N 票 × M 策略」—— 适合**选策略 / 选票**的横向对比。\n\n⚠️ **规模上限**（单次请求）：\n- 标的 ≤ 20 只 · 策略 ≤ 10 条 · **组合总数 ≤ 60**\n- **超限直接拒绝**（⛔ 不静默截断 —— 截断会让你以为全跑了）\n\n⚠️ **单票失败不中断整批**（该组合记 `error`，其余照跑）。\n⚠️ **成本与约束同 `/v1/backtest`**（佣金/印花税/过户费/滑点 · 涨跌停 · 停牌）。\n\n⚠️ 属**付费层**（需 API Key）—— 门槛 **`pro`（¥99）及以上**。\n⚠️ **日额度**：`pro` 20 次 / 日 · `unlimited` 100 次 / 日。",
        "operationId": "backtest_batch_v1_backtest_batch_get",
        "parameters": [
          {
            "name": "codes",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "逗号分隔的标的（≤20 只），如 sh600519,sz000001",
              "title": "Codes"
            },
            "description": "逗号分隔的标的（≤20 只），如 sh600519,sz000001"
          },
          {
            "name": "strategies",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "逗号分隔的策略名（≤10 条）",
              "default": "buy_hold",
              "title": "Strategies"
            },
            "description": "逗号分隔的策略名（≤10 条）"
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "起始日 YYYY-MM-DD",
              "default": "2019-01-01",
              "title": "Start"
            },
            "description": "起始日 YYYY-MM-DD"
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "结束日 YYYY-MM-DD（省略=最新）",
              "default": "",
              "title": "End"
            },
            "description": "结束日 YYYY-MM-DD（省略=最新）"
          },
          {
            "name": "initial_cash",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "description": "初始资金（每次回测）",
              "default": 1000000,
              "title": "Initial Cash"
            },
            "description": "初始资金（每次回测）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/factors": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "量化因子库（88 因子 + 50 筛选入口 + 预设模板）",
        "description": "⭐ **量化因子库 / 筛选能力字典**：列出全部可用于筛选的因子与入口。\n\n**包含**：\n- **88 个因子**（估值 6 / 行情 2 / 盈利 34 / 资产负债 33 / 现金流 13）—— 代码 / 中文名 / 单位 / 说明\n- **50 个非因子筛选入口**：排行 18 · 标签 21 · 事件 11（⭐ 含排雷类：`risk_st` ST股 / `risk_delisting` 退市 / `fin_unhealthy_growth` 增收不增利 / `shareunlock_next_90` 未来90天解禁 …）\n- **22 个预设**（`--preset` 调用，含中文说明）\n- **14 个策略模板**（可直接复制的完整表达式）\n- **8 条使用铁律** + **12 条易错写法对照** + **后缀命名规则**\n\n**怎么用**：把因子写成表达式传给 `/v1/screen`，例如\n`intersect([PE_TTM > 0, PE_TTM < 20, ROETTM > 15])`\n\n**语法**：多条件用 `intersect([...])` 取交集（AND）；比较符仅支持 `> < >= <= = !=`；⛔ 不支持 `between` / `in` / `OR`。\n\n⭐ **支持历史截面**：`/v1/screen?date=YYYY-MM-DD` 可取**任意历史交易日**的因子值（实测 2016-08-08 起有数据）⇒ 可串成 `因子 → 筛选 → 回测` 的完整研究链路。\n\n⚠️ **最常见的一条坑**：`PE_TTM > 0` 必须前置（亏损股 PE 为负，会被当成『低 PE』选入）。\n\n⚠️ 本端点是**静态清单**（不含重型额度）。\n⚠️ 属**付费层**（需 API Key）—— 门槛 **`standard`（¥29.9）及以上**。",
        "operationId": "factors_v1_factors_get",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "按分类过滤：估值/行情/盈利/资产负债/现金流（省略=全部）",
              "default": "",
              "title": "Category"
            },
            "description": "按分类过滤：估值/行情/盈利/资产负债/现金流（省略=全部）"
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "只看筛选入口：排行/标签/事件（省略=不限）",
              "default": "",
              "title": "Kind"
            },
            "description": "只看筛选入口：排行/标签/事件（省略=不限）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/playbooks": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "量化方法论库（怎么判断市场 · 怎么避坑）",
        "description": "⭐ **量化方法论库**：一套套「怎么判断市场」的可复用流程 —— **每条都写清判据、阶段、应对，以及它能帮你避开什么亏损**。\n\n**与另外两个端点的分工**：\n| 端点 | 回答什么 |\n|---|---|\n| `/v1/factors` | 有哪些**可算的数值**（`PE_TTM` = 15.3）|\n| `/v1/playbooks` | **怎么看市场 / 怎么判断**（本端点）|\n| `/v1/strategies` | 按什么**规则买卖** |\n| `/v1/backtest` | 这套做法**历史表现如何** |\n\n**每条方法论包含**：\n- `question` 它回答什么问题\n- `signals` **判据**（算式 + 所需数据 + 阈值）—— 全部**可计算**\n- `stages` **阶段划分**（如情绪冰点/启动/发酵/高潮/退潮 + 各阶段应对）\n- `avoids` ⭐ **能避开什么亏损**（本库的核心定位）\n- `evidence` ⚠️ **实测证据**（跑过的回测数字；未跑过的写明「待实测」，⛔ 不编数字）\n\n**覆盖 12 类玩法**：风险管理 · 动量趋势 · 基本面挖掘 · 估值分位 · 组合配置 · 资金流向 · 技术择时 · 板块轮动 · 情绪周期 · 量能分析 · 事件驱动 · 涨停打板。\n\n⚠️ **方法论是「判断流程」，不是投资建议** —— 阈值是可调起点，⛔ 不构成买卖推荐。历史回测不代表未来表现。\n\n⚠️ 本端点是**静态清单**（不含重型额度）。\n⚠️ 属**付费层**（需 API Key）—— 门槛 **`standard`（¥29.9）及以上**。",
        "operationId": "playbooks_v1_playbooks_get",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "按玩法过滤（如 情绪周期/风险管理；省略=全部）",
              "default": "",
              "title": "Category"
            },
            "description": "按玩法过滤（如 情绪周期/风险管理；省略=全部）"
          },
          {
            "name": "id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "按 id 取单条（如 sentiment-cycle）",
              "default": "",
              "title": "Id"
            },
            "description": "按 id 取单条（如 sentiment-cycle）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/wiki": {
      "get": {
        "tags": [
          "free"
        ],
        "summary": "文档检索（字段 / 口径 / 常见误用）",
        "description": "⭐ **产品文档检索**：字段单位、口径说明、常见误用、跨市场差异 —— **当你（agent）不确定某字段含义/单位/口径时先查这里，比猜更准**。\n\n**渐进加载（三步走，省 token）**：\n| 调用 | 返回 | 大小 |\n|---|---|---|\n| `/v1/wiki`（不带参） | **目录**：slug + 标题 + 一句话 | 小 |\n| `/v1/wiki?q=关键词` | **命中篇的摘要**（标题 + lead + 匹配片段），⚠️ 不含全文 | 中 |\n| `/v1/wiki?slug=units` | **该篇全文**（正文 Markdown） | 单篇 |\n\n⚠️ **不会一次性吐出全部文档**（全文合计 70KB+）—— 请先看目录、再取单篇，避免浪费你的上下文。\n`lang`：`zh`（默认）/ `en`。\n⚠️ 属**免费层**（无需 API Key）—— 但**每次调用仍计入用量与限流**。",
        "operationId": "wiki_v1_wiki_get",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "关键词检索（如 '换手率单位' / 'code 格式'）；留空=返回目录",
              "default": "",
              "title": "Q"
            },
            "description": "关键词检索（如 '换手率单位' / 'code 格式'）；留空=返回目录"
          },
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "取某一篇全文（如 units / kline-fields）；留空=不用",
              "default": "",
              "title": "Slug"
            },
            "description": "取某一篇全文（如 units / kline-fields）；留空=不用"
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "语言：zh（默认）/ en",
              "default": "zh",
              "title": "Lang"
            },
            "description": "语言：zh（默认）/ en"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/minute": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "分时（当日 / 近 5 日盘中走势）",
        "description": "**分时数据**：盘中每分钟的价格与累计成交量。用户问『今日分时 / 盘中走势 / 分钟级走势 / 今天怎么走的』时用这个。\n\n⚠️ 与 `/v1/kline` 的**分钟线**（`period=m1~m120`）是**两件不同的东西**：本端点 = **分时**（每分钟一个价 + 累计量）；`kline` 分钟线 = **分钟 K 线**（每分钟一根 OHLC 蜡烛）。\n\n⚠️ **`days` 只有两档**（2026-10-06 实测，非推测）：**`1` = 当日**（默认）、**`5` = 近 5 个交易日**。⛔ **没有 2/3/4 这种『取 N 天』** —— 传 2/3/4 上游**不报错但一律返回整 5 日**（实测 `--days 2` 与 `--days 5` **逐字节完全相同**），故参数校验只放行 1 与 5，避免『要 2 天给 5 天』的静默错口径。\n⚠️ **字段随标的与 days 不同**（不是固定列）：`code time price volume amount`（`days=1`）；`days=5` 多一列 `date`；**板块 / 美股 / 北交所**无 `amount`（列随上游而定，别硬编码列数）。\n⚠️ **期货（`fu*`）/ 外汇（`fx*`）只有 `price` `time` 两列**（单一标的故不带 `code`）。\n⚠️ 覆盖标的：A股 / 指数 / 板块 / ETF / 可转债 / 港股 / 美股 / **北交所** / **期货 / 外汇**（期货·外汇走的通道与其余标的**不同** —— 这两类只有该通道有数据）。\n⚠️ **属付费层**（需 API Key）—— 门槛 **`standard`（¥29.9）及以上**，`trial`（¥9.9）不可用。\n⚠️ **付费档实时**（每次取此刻最新）—— 本端点自 `standard` 起，调用方均为付费档，故无缓存。",
        "operationId": "minute_v1_minute_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "股票代码：sh600667；同样支持 指数 sh000001 / 板块 pt01801081 / ETF sh510300 / 港股 hk00700 / 美股 usAAPL / 可转债 sz128136 / 北交所 bj920047 / 期货 fuCN / 外汇 fxCNH",
              "title": "Code"
            },
            "description": "股票代码：sh600667；同样支持 指数 sh000001 / 板块 pt01801081 / ETF sh510300 / 港股 hk00700 / 美股 usAAPL / 可转债 sz128136 / 北交所 bj920047 / 期货 fuCN / 外汇 fxCNH"
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "分时档位：1 = 当日（默认）· 5 = 近 5 个交易日（**没有 2/3/4**）",
              "default": 1,
              "title": "Days"
            },
            "description": "分时档位：1 = 当日（默认）· 5 = 近 5 个交易日（**没有 2/3/4**）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/hot": {
      "get": {
        "tags": [
          "free"
        ],
        "summary": "热度榜（5 类，字段各不相同）",
        "description": "**关注度**排名（谁在被关注，⛔ 不是「谁在涨」）。用户问『什么股票热门/大家在看什么/热度榜/热门板块/热文』时用这个。\n\n⚠️⚠️ **5 类的字段结构完全不同**，⛔ 别按同一套字段读：\n· `type=stock`（默认）热搜**股票**：`code` · `name` · `zdf` 涨跌幅 · `zxj` 最新价\n· `type=wx` 全市场热度**股票**：同 stock，⭐ **多 `pv` 热度值**（唯一能量化热度）\n· `type=news` 热门**文章**：⚠️ **`news_id` · `news_title` · `source`** —— ⛔ **没有 code/name**\n· `type=sector` 热门**板块**：⚠️ **`symbol`**（pt0…）· `name` · `rankdelta` 排名变化 —— ⛔ **没有 code**\n· `type=etf` 热搜 **ETF**：`code` · `name` · `title` 涨幅说明 · `tag` 标签\n\n⚠️ 这是**当前快照**（上游无历史、无趋势）—— 别用它算「热度变化」。",
        "operationId": "hot_v1_hot_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "返回条数，默认 30（榜单上限 50，超出按 50 返回）",
              "default": 30,
              "title": "Limit"
            },
            "description": "返回条数，默认 30（榜单上限 50，超出按 50 返回）"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "stock 热搜股票 / wx 全市场热度（带 pv）/ news 热门文章 / sector 热门板块 / etf 热搜 ETF（⚠️ 5 类字段各不相同）",
              "default": "stock",
              "title": "Type"
            },
            "description": "stock 热搜股票 / wx 全市场热度（带 pv）/ news 热门文章 / sector 热门板块 / etf 热搜 ETF（⚠️ 5 类字段各不相同）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/news": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "个股资讯（列表 / 详情）",
        "description": "个股/指数/ETF/板块/可转债的**财经资讯**。**不传 `id`** ⇒ 列表（`code` 必填，返回标题 + 来源 + 时间）；**传 `id`** ⇒ ⭐ 该条**完整正文**。用户问『这股票最近有什么新闻/消息面/这条新闻讲了什么』时用这个。\n\n⭐ **正文是干净的 Markdown**（已清洗：去 HTML 标签/图片占位/无效内链，保留股票代码关联如 `茅台(sh600519)`；时间格式 `YYYY-MM-DD HH:MM:SS`）—— **可直接喂给大模型**，无需再处理。\n⚠️ 列表**只有最新 N 条**（上游不提供翻页/历史）—— 要**历史公告**请用 /v1/notice。\n⚠️ 列表里的 `url` 指向动态页面，**直接抓不到正文** ⇒ 要正文请用本端点的 `id` 参数。",
        "operationId": "news_v1_news_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "个股/指数/ETF/板块代码：sh600519 / 000001 / sz300750（取列表时必填）",
              "default": "",
              "title": "Code"
            },
            "description": "个股/指数/ETF/板块代码：sh600519 / 000001 / sz300750（取列表时必填）"
          },
          {
            "name": "id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "资讯 id（如 SN20261010173533a6c32421）—— 传它就取**完整正文**（Markdown），此时 code 可省",
              "default": "",
              "title": "Id"
            },
            "description": "资讯 id（如 SN20261010173533a6c32421）—— 传它就取**完整正文**（Markdown），此时 code 可省"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "返回条数，默认 50（上限 100）",
              "default": 50,
              "title": "Limit"
            },
            "description": "返回条数，默认 50（上限 100）"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "可选：按资讯类型过滤（传 1 只返「研报」类）",
              "default": "",
              "title": "Type"
            },
            "description": "可选：按资讯类型过滤（传 1 只返「研报」类）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notice": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "公告（列表 / 详情）",
        "description": "上市公司公告。**不传 `id`** ⇒ 列表（`code` 必填，支持 type / limit / offset 翻页，可回溯约 16 年 —— 实测茅台 929 条到 2010 年）；**传 `id`** ⇒ 该公告详情。用户问『公告/披露/半年度报告/年报在哪』时用这个。\n\n⚠️ **详情返回两种形态**（实测：约 9/10 给正文）：\n· 多数（短公告）⇒ `text` = **正文**（纯文本），`url` 为空 —— **直接读 `text`**\n· 少数（长报告，如半年报/年报 100+ 页）⇒ `text` 为空，`url` = **PDF 链接**\n⇒ 判据：**先看 `text` 有没有值**，空则用 `url`。\n\n⚠️ **长报告的 PDF 请自行获取与解析**（如用你环境里的 PDF 能力/库）——我们只提供链接，**不代做解析**。\n💡 **要财务数字（营收/利润/资产/现金流）请直接用 `/v1/finance`** —— 它是**结构化**的，比从 100+ 页 PDF 里抠数字快得多也准得多。\n⚠️ `notice` 与 `report`（研报）不同：本端点只给**上市公司公告**。",
        "operationId": "notice_v1_notice_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "股票代码（取列表时必填）：sh600519 / sz000001",
              "default": "",
              "title": "Code"
            },
            "description": "股票代码（取列表时必填）：sh600519 / sz000001"
          },
          {
            "name": "id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "公告 id（如 nos1225475868）—— 传它就取**详情**，此时 code 可省",
              "default": "",
              "title": "Id"
            },
            "description": "公告 id（如 nos1225475868）—— 传它就取**详情**，此时 code 可省"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "可选：公告类型 0-7（⛔ 不是 01010503 这类信披码，传错会静默返全量）",
              "default": "",
              "title": "Type"
            },
            "description": "可选：公告类型 0-7（⛔ 不是 01010503 这类信披码，传错会静默返全量）"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "返回条数，默认 50（上限 100）",
              "default": 50,
              "title": "Limit"
            },
            "description": "返回条数，默认 50（上限 100）"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "偏移量（**有效**，0 ~ total−1）—— 翻历史用，如 offset=900 可得约 2010 年",
              "default": 0,
              "title": "Offset"
            },
            "description": "偏移量（**有效**，0 ~ total−1）—— 翻历史用，如 offset=900 可得约 2010 年"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/market-overview": {
      "get": {
        "tags": [
          "free"
        ],
        "summary": "市场总览（大盘画像）",
        "description": "市场整体画像。type=summary 总评画像 / trade 收盘 / interval 多周期 / technical 大盘技术 / margin 两融 / valuation 估值分位 / rotation 风格轮动。用户问『今天市场怎么样/大盘情况/市场环境/风格轮动/估值分位』时用这个。⚠️ type=updown（涨跌分布）是 **T-1 口径**（返回里会标数据日期，可能滞后一个交易日）—— 要**当期**涨跌家数/涨停家数/市场广度，请用 /v1/changedist（两者数值会不同）。",
        "operationId": "market_overview_v1_market_overview_get",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "类型：summary/trade/interval/technical/margin/valuation/rotation（updown 为 T-1 口径，当期涨跌家数请用 /v1/changedist）",
              "default": "summary",
              "title": "Type"
            },
            "description": "类型：summary/trade/interval/technical/margin/valuation/rotation（updown 为 T-1 口径，当期涨跌家数请用 /v1/changedist）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/changedist": {
      "get": {
        "tags": [
          "free"
        ],
        "summary": "涨跌分布（市场广度）",
        "description": "全市场涨跌家数、涨跌停家数、停牌、成交额与涨跌幅区间分布——衡量市场广度与情绪（**当期口径**）。这是市场广度的推荐入口：不要用 /v1/market-overview?type=updown 取同一数据（那是 T-1 口径，数值会不一致）。",
        "operationId": "changedist_v1_changedist_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/finance": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "财务报表",
        "description": "财务报表三件套：利润表 / 资产负债表 / 现金流量表（多期，最近 N 期）。用户问『营收/净利润/毛利率/负债/财务数据』时用。\n\n⚠️ data 是【表列表】：data[0]=利润表 · data[1]=资产负债表 · data[2]=现金流量表；每张表是 [{EndDate: …, 字段: …}]，期次降序（最新一期在最前）。\n⚠️ 2026-09-25 修正：此前返回的是最早 N 期（可能不含最新披露期）—— 已改为最近 N 期。",
        "operationId": "finance_v1_finance_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "股票代码：sh600667",
              "title": "Code"
            },
            "description": "股票代码：sh600667"
          },
          {
            "name": "num",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "返回期数，默认 4 期（最近 N 期，降序）",
              "default": 4,
              "title": "Num"
            },
            "description": "返回期数，默认 4 期（最近 N 期，降序）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/fund": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "个股资金+龙虎榜+大宗+两融（综合）",
        "description": "一个接口拿全交易面：主力资金（当日/5/10/20 日净流入 + 全市场排名）、龙虎榜（上榜原因/买卖总额/营业部明细）、大宗交易、融资融券。用户问『主力资金/资金流/龙虎榜/机构动向』时优先用这个。",
        "operationId": "fund_v1_fund_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "股票代码：sh600667",
              "title": "Code"
            },
            "description": "股票代码：sh600667"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/fund-batch": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "批量资金流（多股一次取）",
        "description": "⭐ **一次拿多只股票的资金流**（主力资金 + 龙虎榜 + 大宗 + 融资融券），每只一条记录。**给量化/批量研究用** —— 一次扫一个行业或自选池，不必一只一只调 `/v1/fund`。\n\n**用法**：`codes` 用**逗号分隔**，如 `?codes=sh600519,sz000001,sz300750`。\n\n**返回**：`data` 是数组，每项含 `code` / `ok` / `data`（或 `error`）—— **逐只标明成功与否**；同时给出 `requested` / `returned` / `failed` 计数。\n\n**上限**：专业版单次最多 **200** 只（约一个行业），不限量版 **1000** 只。**计费按实际返回只数**（失败的不计）。\n\n⚠️ **标的范围**：资金流数据仅覆盖 **A 股**（`sh`/`sz`/`bj`）；港股仅主力净流入一项，**美股无资金流数据**（该只会标 `ok:false`）。",
        "operationId": "fund_batch_v1_fund_batch_get",
        "parameters": [
          {
            "name": "codes",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "多个股票代码，逗号分隔：sh600519,sz000001,sz300750",
              "title": "Codes"
            },
            "description": "多个股票代码，逗号分隔：sh600519,sz000001,sz300750"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/quote-batch": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "批量行情（多只一次取）",
        "description": "⭐ **一次拿多只股票的行情**，**逐只标明成功与否** —— 给量化/批量研究用。\n\n**它解决什么**：自己写循环取 300 只 = 300 次请求 × 约 0.7 秒 ≈ **3.5 分钟**（还会撞限频退避）；本端点实测 **4.16 秒**拿完沪深300 全 300 只。\n\n**用法**：`codes` 用**逗号分隔**，如 `?codes=sh600519,sz000001,sz300750`；支持裸 6 位码（`600519`）与带前缀（`sh600519`）。\n\n**返回**：`data` 是数组，每项 `{code, ok, data}`（或 `error`）—— **取了几只就回几个条目**，缺失的显式标 `ok:false` 并给原因；同时给 `requested` / `returned` / `failed` 计数。\n\n⚠️ **与 `/v1/quote` 的区别**：`/v1/quote` 的 `code` 虽也支持逗号，但返回是**扁平行且不带逐只状态**（缺了哪只要自己算）；本端点**逐只回填**，缺谁一眼可见。\n\n**上限**：专业版单次最多 **200** 只，不限量版 **1000** 只（一次判 300 只 4.16 秒实测可跑通）。**计费按实际返回只数**（失败的不计）。\n\n⚠️ `period` 默认 `day`；`count` 默认 **1**（只取最新一条，最省）。要 N 天历史就传 `count=N`（**每只各 N 条**，实测 3 只 × 30 = 90 行）。\n\n⚠️ 换手率字段名是 **`turnover`**（%，与 `/v1/quote` 同名同值）。\n\n⚠️ **付费端点**：**专业版（¥99）及以上**，标准版不可用。",
        "operationId": "quote_batch_v1_quote_batch_get",
        "parameters": [
          {
            "name": "codes",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "多个股票代码，逗号分隔：sh600519,sz000001,sz300750",
              "title": "Codes"
            },
            "description": "多个股票代码，逗号分隔：sh600519,sz000001,sz300750"
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "周期：day/week/month/season/year 或 m1~m120",
              "default": "day",
              "title": "Period"
            },
            "description": "周期：day/week/month/season/year 或 m1~m120"
          },
          {
            "name": "count",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "每只返回几条，默认 1（只取最新）",
              "default": 1,
              "title": "Count"
            },
            "description": "每只返回几条，默认 1（只取最新）"
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "起始日期 YYYY-MM-DD（可选）",
              "default": "",
              "title": "Start"
            },
            "description": "起始日期 YYYY-MM-DD（可选）"
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "结束日期 YYYY-MM-DD（可选）",
              "default": "",
              "title": "End"
            },
            "description": "结束日期 YYYY-MM-DD（可选）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/kline-batch": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "批量 K 线（多只一次取）",
        "description": "⭐ **一次拿多只股票的 K 线**（多只 × 同一段时间），**逐只标明成功与否** —— 给量化/批量研究用。\n\n**它解决什么**：自己循环取 200 只 × 30 天 = 200 次请求 ≈ **2.3 分钟**（还会撞限频退避）；本端点实测 **3.39 秒**拿完（6,000 行，200 只全部返回）。\n\n**与其它三个 K 线端点的分工（务必看清）**：\n| 端点 | 取什么 |\n|---|---|\n| `/v1/kline` | 一只（`code` 虽接受逗号，但返回扁平行、缺了哪只算不出来）|\n| `/v1/kline-full` | **一只 × 全部历史**（约 2465 根）|\n| `/v1/market-kline` | **某一天 × 全市场**（按日期驱动）|\n| **本端点** | **多只 × 同一段时间**（按代码列表驱动）|\n\n**用法**：`codes` 逗号分隔，如 `?codes=sh600519,sz000001,sz300750`；支持裸 6 位码与带前缀。\n\n**返回**：`data` 是数组，每项 `{code, ok, data:[...]}`（或 `error`）—— **取几只就回几个条目**，`data` 内是该只的 K 线数组；同时给 `requested` / `returned` / `failed` 计数。\n\n**上限**：专业版单次最多 **200** 只，不限量版 **1000** 只；另受**总条数 6 万**约束（标的数 × `count` ≤ 60,000，如 200 只 × 300 根触顶）。**计费按实际返回只数**（失败的不计）。\n\n⚠️ `period` 默认 `day`；`count` 默认 **30**（每只各 30 根，与 `/v1/kline` 一致）。⚠️ 换手率字段名是 **`turnover`**（%，与 `/v1/kline` 同名同值）；返回字段固定 8 列（`symbol` `date` `open` `last` `high` `low` `volume` `amount` `turnover`）。\n\n⚠️ **付费端点**：**专业版（¥99）及以上**，标准版不可用。",
        "operationId": "kline_batch_v1_kline_batch_get",
        "parameters": [
          {
            "name": "codes",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "多个股票代码，逗号分隔：sh600519,sz000001,sz300750",
              "title": "Codes"
            },
            "description": "多个股票代码，逗号分隔：sh600519,sz000001,sz300750"
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "周期：day/week/month/season/year 或 m1~m120",
              "default": "day",
              "title": "Period"
            },
            "description": "周期：day/week/month/season/year 或 m1~m120"
          },
          {
            "name": "count",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1212,
              "minimum": 1,
              "description": "每只返回几根，默认 30",
              "default": 30,
              "title": "Count"
            },
            "description": "每只返回几根，默认 30"
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "起始日期 YYYY-MM-DD（可选）",
              "default": "",
              "title": "Start"
            },
            "description": "起始日期 YYYY-MM-DD（可选）"
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "结束日期 YYYY-MM-DD（可选）",
              "default": "",
              "title": "End"
            },
            "description": "结束日期 YYYY-MM-DD（可选）"
          },
          {
            "name": "fq",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "复权：qfq 前复权 / hfq 后复权 / nofq 不复权（留空 = 服务端默认）",
              "default": "",
              "title": "Fq"
            },
            "description": "复权：qfq 前复权 / hfq 后复权 / nofq 不复权（留空 = 服务端默认）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/snapshot-batch": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "批量全字段画像（多只一次取）",
        "description": "⭐ **一次拿多只股票的完整画像**（35+ 字段：价格/盘口五档/PE·PB/市值/股本/涨停跌停价/量比/振幅/涨速/外盘内盘），**逐只标明成功与否**。\n\n**它解决什么**：`/v1/snapshot` 只接单只，扫一个池子只能循环（100 只 = 100 次请求 ≈ 30 秒）；本端点一次拿完，实测 **300 只 0.40 秒**（比 `/v1/quote-batch` 快 10 倍）。\n\n**用法**：`codes` 用**逗号分隔**，如 `?codes=sh600519,sz000001,sz300750`；支持裸 6 位码与带前缀。\n\n**返回**：`data` 是数组，每项 `{code, ok, data}`（或 `error`）—— **取几只就回几个条目**；同时给 `requested` / `returned` / `failed` 计数。\n\n**上限**：专业版单次最多 **200** 只，不限量版 **250** 只。**计费按实际返回只数**（失败的不计）。\n\n⚠️ **仅 A 股**（`sh`/`sz`/`bj`）—— 港股/美股字段布局不同，传了会标 `ok:false` 并提示改用 `/v1/quote`（⛔ 不返回错数据）。\n\n⚠️ **单位**：`volume` 手 · `amount` 万元 · 市值 亿元 · 股本 股 · 比率/涨幅 百分数。\n\n⚠️ **付费端点**：**专业版（¥99）及以上**，标准版不可用。",
        "operationId": "snapshot_batch_v1_snapshot_batch_get",
        "parameters": [
          {
            "name": "codes",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "多个股票代码，逗号分隔：sh600519,sz000001（专业版 ≤200 只 · 不限量版 ≤250 只）",
              "title": "Codes"
            },
            "description": "多个股票代码，逗号分隔：sh600519,sz000001（专业版 ≤200 只 · 不限量版 ≤250 只）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/technical": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "技术指标",
        "description": "技术指标全家桶：MA / MACD / KDJ / RSI / BOLL。用户问『技术面/指标/金叉死叉/超买超卖』时用。",
        "operationId": "technical_v1_technical_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "股票代码：sh600667",
              "title": "Code"
            },
            "description": "股票代码：sh600667"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shareholder": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "股东研究",
        "description": "股东研究（多段返回）。用户问『谁在持有/股东变化/筹码集中/机构持仓』时用。\n\n⚠️ data 是【多段结构】：data.tables 是**表列表**（保序），每段含 title（中文标题）/ slug（英文键）/ rows。A股 3 段：top10_holders 十大股东 · top10_float_holders 十大流通股东 · holder_count 股东户数统计（含 totalSHNum/aSHNum/avgHoldShares，看筹码集中度）。港股 3 段：shareholders 持股股东信息 · holder_distribution 股东分布 · institutional_holdings 机构持仓统计（两者段语义不同，勿按序号取）。另有 data.data{slug: rows} 便捷索引。",
        "operationId": "shareholder_v1_shareholder_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "股票代码：sh600667",
              "title": "Code"
            },
            "description": "股票代码：sh600667"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chip": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "筹码分布/成本",
        "description": "筹码分布与持仓成本（套牢盘/获利盘比例，判断抛压）。返回：筹码/成本分布/集中度/时段。`date` 可回看历史（`YYYY-MM-DD`，缺省=最新）。⚠️ **历史仅保留约近 1 年**（实测 2025-10-24 起；更早返回空 ⇒ `ok:false` 且不扣次数）。⚠️ **非交易日/未来日期会自动回退到最近交易日** —— 返回行的 `date` 才是实际日期，以它为准。⚠️ **仅沪深 A 股**（港股/美股不支持）；代码可传 `sh600667` 或裸 6 位 `600667`。",
        "operationId": "chip_v1_chip_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "股票代码：sh600667 / 600667",
              "title": "Code"
            },
            "description": "股票代码：sh600667 / 600667"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "交易日 YYYY-MM-DD（默认最新）。非交易日自动回退到最近交易日，以返回的 date 为准",
              "default": "",
              "title": "Date"
            },
            "description": "交易日 YYYY-MM-DD（默认最新）。非交易日自动回退到最近交易日，以返回的 date 为准"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orderbook": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "五档盘口（order book · 买五卖五）",
        "description": "**秒级快照**：买一~买五 / 卖一~卖五的**价格与挂单量（手）**，含现价/涨跌/数据时间。字段命名对齐 Tushare 惯例：`b1_p`/`b1_v` ~ `b5_p`/`b5_v` = 买档价格/量，`a1_p`/`a1_v` ~ `a5_p`/`a5_v` = 卖档（**扁平列，pandas 直接取 `df['b1_p']`**）。用途：看封单强度、买卖压力、盘中支撑压力位。⚠️ **盘中才有意义**（收盘后为当日最后快照）；数据约 10 秒刷新一次。⚠️ 量单位是**手**（×100 = 股）；**跌停时买档全 0 / 涨停时卖档全 0**（正常现象）。",
        "operationId": "orderbook_v1_orderbook_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "股票代码：sh600667",
              "title": "Code"
            },
            "description": "股票代码：sh600667"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/snapshot": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "全字段行情画像（估值/市值/股本/涨停价）",
        "description": "**一只股票的完整画像**：价格 + 盘口（买五卖五+委差）+ 估值（PE TTM/动/静 + PB） + 市值（流通/总）+ 股本（流通/总）+ 打板（涨停/跌停价 + 量比 + 振幅 + 涨速） + 标识（证券类型/股票状态/币种）+ 外盘/内盘。⚠️ **与 `/v1/quote` 的分工**：quote 轻（8 字段）· 走官方通道 · **免费**；本端点全（35 字段）· **pro 档**。只要现价用 quote 更轻（字段少、响应快）。⚠️ **仅 A 股**（港股/美股字段布局不同，请用 `/v1/quote`）——**传其他市场返回空，不返回错数据**。⚠️ **计费 = 次数**：本端点 1 次拿全 35 字段——**要估值+市值+股本+涨停价多项时，比分别调 quote/valuation/orderbook 更省次数**。⚠️ 单位：`volume` 手 · `amount` 万元 · 市值 亿元 · 股本 股 · 比率/涨幅 百分数。（字段含义见 https://ashareapi.com/docs/）",
        "operationId": "snapshot_v1_snapshot_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "A 股代码：sh600667 / 600667 / sz300750",
              "title": "Code"
            },
            "description": "A 股代码：sh600667 / 600667 / sz300750"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/abnormal": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "异动 / 偏离值（监管异动体系）",
        "description": "**短线监管异动 / 偏离值**：触发「严重异动」、「10日100% 偏离」、异动盯盘名单、严重异动提醒。这是**短线风控的关键信号**（个股因连续大涨/大跌被交易所或数据方标记异动）。\n\n`mode` 取值：\n· `deviation` **偏离值热门榜**（今日实时）—— 触发偏离阈值的个股，含 `reason` 规则 / `pct` 涨幅 / `turnover` 换手 / `board_desc` 连板 / `concepts` 概念 / `window` 窗口\n· `deviation_hist` **偏离值热门榜（历史）**—— 需 `date`（YYYY-MM-DD，真实交易日）\n· `deviation_plan` **偏离值（今日 + 明日两组）**—— 返回行数组，每行含 `group`（`today`/`tomorrow`）区分\n· `abnormal` **异动频率（含异动原因）**—— 需 `date`；⭐ 每日全量（常见 500+ 条），含 `reason` 规则 / `status` 异动状态 / `abn_start` 异动起始日；顶层附 `total` 当日总条数\n· `watch` **异动盯盘名单（今日）**—— 监控中的个股 + `watch_start`/`watch_end`\n· `watch_hist` **异动盯盘名单（历史）**—— 需 `date`\n· `alert` **严重异动提醒（今日）**—— ⭐ 短线重点：`reason` 为**人读提醒原因**（如「10日内3次异动个股」「10日内偏离值临近100%」）+ `price` 现价\n\n**字段口径**（各 mode 按需返回下列子集）：\n`code` 代码 · `name` 名称 · `reason` 触发/提醒原因 · `pct` 涨跌幅% · `board_desc` 连板描述 · `concepts` 概念（顿号分隔）· `turnover` 换手%（偏离榜）· `window` 偏离窗口（如 `10日`）· `rule2` 第二条规则 · `trigger_pct` 触发严重异动阈值% · `limit_price` 参考价 · `status` 异动状态（如「未触发异动」）· `date` 数据日期 · `price` 现价 · `abn_start` 异动起始日（未触发为 `0000-00-00`）· `group` 分组（仅 plan）· `watch_start`/`watch_end` 监控起止（仅 watch）。\n\n⚠️ 历史类 mode（`deviation_hist`/`abnormal`/`watch_hist`）的 `date` 须为**真实交易日**（非交易日返回空）；缺省用今天。\n⚠️ `abnormal` 默认返回当日**全量**（`limit` 可调，默认 600，足以覆盖）。\n⚠️ `data` 恒为**行数组**（可直接落 DataFrame）；`abnormal` 的当日总条数在顶层 `total`。",
        "operationId": "abnormal_v1_abnormal_get",
        "parameters": [
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(deviation|deviation_hist|deviation_plan|abnormal|watch|watch_hist|alert)$",
              "description": "deviation / deviation_hist / deviation_plan / abnormal / watch / watch_hist / alert",
              "default": "deviation",
              "title": "Mode"
            },
            "description": "deviation / deviation_hist / deviation_plan / abnormal / watch / watch_hist / alert"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "历史类 mode 需要的日期（YYYY-MM-DD）；空=今天",
              "default": "",
              "title": "Date"
            },
            "description": "历史类 mode 需要的日期（YYYY-MM-DD）；空=今天"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 2000,
              "minimum": 1,
              "description": "仅 mode=abnormal/alert 生效：单次返回上限（默认 600）",
              "default": 600,
              "title": "Limit"
            },
            "description": "仅 mode=abnormal/alert 生效：单次返回上限（默认 600）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/review": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "复盘（涨停结构：板块主线 / 连板梯队）",
        "description": "**短线复盘（涨停结构）**：看今天钱在哪些题材、梯队结构长什么样。\n\n`mode` 取值：\n· `board` **板块主线**（默认）—— 当日涨停最集中的题材板块：`board_code` 板块码 / `board_name` 板块名 / `limit_count` 板块涨停数 / `amount` 板块成交额（元）/ `stocks` 成分股代码（逗号分隔）\n· `ladder` **连板梯队** —— 按连板高度分组的涨停个股：`code` / `name` / `streak` 连板数 / `limit_time` 涨停时间（Unix 秒）/ `board_code`·`board_name` 所属板块 / `board_limit_count` 板块涨停数 / `market_cap` 总市值（元）/ `board_amount` 板块成交额（元）/ `tips`（如「7天4板」）/ `max_streak` 区间最高连板数 / `limit_days` 区间涨停天数 / `is_repack` 反包标记\n\n⚠️ `date` 为空 = 实时；给 `YYYY-MM-DD` = 该交易日历史（须为**真实交易日**，非交易日返回空）。\n⚠️ `data` 恒为**行数组**（可直接落 DataFrame）；条数在顶层 `count`。",
        "operationId": "review_v1_review_get",
        "parameters": [
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(board|ladder)$",
              "description": "board 板块主线 / ladder 连板梯队",
              "default": "board",
              "title": "Mode"
            },
            "description": "board 板块主线 / ladder 连板梯队"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "历史日期（YYYY-MM-DD）；空=实时",
              "default": "",
              "title": "Date"
            },
            "description": "历史日期（YYYY-MM-DD）；空=实时"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/limit-up": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "打板（涨停池明细）",
        "description": "**短线打板（涨停池明细）**：当日全部涨停个股，含**涨停原因**与**资金面**。\n\n`mode` 取值：\n· `limit` **涨停池明细**（默认）—— `code` / `name` / `streak` 连板数 / `limit_time` 涨停时间（Unix 秒）/ `reason` 涨停原因 / `seal_amount` 封单额（元）/ `seal_amount_max` 最大封单额（元）/ `main_net` 主力净额（元）/ `main_buy`·`main_sell` 主力买入·卖出（元）/ `amount` 成交额（元）/ `concepts` 概念（顿号分隔）/ `float_cap` 流通市值（元）/ `turnover` 换手% / `board_code` 板块码 / `board_limit_count` 板块涨停数 / `pct` 涨幅%\n\n⚠️ `date` 为空 = 实时；给 `YYYY-MM-DD` = 该交易日历史（须为**真实交易日**，非交易日返回空）。\n⚠️ 一次返回**全量**涨停个股（含各连板高度），无需翻页。\n⚠️ `data` 恒为**行数组**（可直接落 DataFrame）；条数在顶层 `count`。",
        "operationId": "limit_up_v1_limit_up_get",
        "parameters": [
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(limit)$",
              "description": "limit 涨停池明细",
              "default": "limit",
              "title": "Mode"
            },
            "description": "limit 涨停池明细"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "历史日期（YYYY-MM-DD）；空=实时",
              "default": "",
              "title": "Date"
            },
            "description": "历史日期（YYYY-MM-DD）；空=实时"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auction": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "集合竞价（当日分时 / 历史逐笔 / 竞价量额）",
        "description": "**短线集合竞价**：个股 9:15–9:25 集合竞价数据，含**「竞价触及涨停」判定**。\n\n`mode` 取值：\n· `stock` **当日竞价分时**（默认）—— 09:15–09:25 逐笔（分钟级 tick）；每行 `time` 时间 / `price` 价 / `stage` 行情源标记位（**语义未公开，请勿依赖**；如需区分可撤单 / 不可撤单段请直接用 `time`：09:15–09:20 可撤单 · 09:20–09:25 不可撤单）/ `volume` 累计量\n· `stock-history` **历史竞价分时**（**秒级**逐笔）—— 需 `date`（YYYY-MM-DD，真实交易日）；每行 `time`（含秒）/ `price` / `volume`\n· `volume` **当日竞价量 / 资金净额**（单点）—— 返回 1 行：`bid_volume` 竞价量（手）/ `bid_amount` 竞价净额（元）\n\n⭐ **`is_limit_up`（顶层 `meta`）= 「竞价触及涨停」判定** —— 判据 = 竞价段最高价 ≥ 涨停价（**涨停价取自行情源原始字段，非推算** ⇒ 主板 10% / 创业板科创 20% / ST 5% / 北交所 30% 差异自动正确）。\n`meta` 另含 `up_px` 涨停价 / `down_px` 跌停价 / `open_px` 09:25 撮合价（开盘价）/ `preclose_px` 昨收 / `hprice` 竞价段最高价。\n\n⚠️ **`mode=stock` 仅当日**（上游限制）；历史请用 `mode=stock-history`。\n⚠️ **`mode=stock` 的点数因标的与市场而异**（同一时段不同票点数不同，由行情节奏决定）—— 需要票与票之间**颗粒度统一**时，请**按分钟取最后一条**自行归一（09:15–09:24 每票 ≤10 点）。\n⚠️ 9:15–9:25 为竞价时段；**盘前/盘后** `mode=stock` 仍可取（竞价时段结束后数据保留）。\n⚠️ `data` 恒为**行数组**（可直接落 DataFrame）；标的级信息在顶层 `meta`。",
        "operationId": "auction_v1_auction_get",
        "parameters": [
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(stock|stock-history|volume)$",
              "description": "stock 当日分时 / stock-history 历史逐笔（需 date）/ volume 竞价量额",
              "default": "stock",
              "title": "Mode"
            },
            "description": "stock 当日分时 / stock-history 历史逐笔（需 date）/ volume 竞价量额"
          },
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "股票代码：sh600667 或 600667（裸码/带前缀均可）",
              "title": "Code"
            },
            "description": "股票代码：sh600667 或 600667（裸码/带前缀均可）"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "历史日期（YYYY-MM-DD）；仅 mode=stock-history 必填",
              "default": "",
              "title": "Date"
            },
            "description": "历史日期（YYYY-MM-DD）；仅 mode=stock-history 必填"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "个股事件标签（42 类）",
        "description": "个股事件总览：大宗交易/龙虎榜/回购/定增/分红/业绩/解禁等 42 类事件标签。",
        "operationId": "events_v1_events_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "股票代码：sh600667",
              "title": "Code"
            },
            "description": "股票代码：sh600667"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/lhb": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "龙虎榜分榜（6 类 · 总榜/机构/席位/高胜率）",
        "description": "全市场龙虎榜，按类型分 6 种榜：\n`all` **全市场总榜**（当日上榜股 · 净买/买卖额）/ `institution` **机构榜**（机构数 / 机构买入 / 净买）/ `activeseat` **活跃席位**（席位买入额 + 关联个股）/ `winbuy` **高胜率买入**（净买额 / 胜率 / 席位明细）/ `winseat` **高胜率席位**（席位胜率 + 关联个股）/ `hotmoney` 游资榜。\n\n⚠️ **`hotmoney` 上游暂无数据**（非交易日或上游未发布时返回引导文案）⇒ 建议改用 `all` / `activeseat` / `winbuy`。\n⚠️ 龙虎榜为**收盘后**发布的数据（一般 18:00 后更新）；`date` 留空 = 最近交易日。\n用户问『龙虎榜 / 机构买了什么 / 游资动向 / 高胜率席位』时用。",
        "operationId": "lhb_v1_lhb_get",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "榜单类型：all 总榜 / institution 机构 / activeseat 活跃席位 / winbuy 高胜率买入 / winseat 高胜率席位 / hotmoney 游资（暂无数据）",
              "default": "institution",
              "title": "Type"
            },
            "description": "榜单类型：all 总榜 / institution 机构 / activeseat 活跃席位 / winbuy 高胜率买入 / winseat 高胜率席位 / hotmoney 游资（暂无数据）"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "日期 YYYY-MM-DD（留空=最近交易日）",
              "default": "",
              "title": "Date"
            },
            "description": "日期 YYYY-MM-DD（留空=最近交易日）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/screen": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "因子选股（量化筛股）",
        "description": "按因子表达式筛选全市场股票。expr 是多因子交集，例如：intersect([PE_TTM > 0, PE_TTM < 20, ROETTM > 15])。preset 用官方 22 个预设名（**大小写/下划线不敏感**：low_pe 等价 LowPE）：LowPE/LowPB/HighDividend/ValuationPercentile/PEG/KDJOversold/RSIOversold/NineTurnGreen9/HighRating/TargetPriceUpside/HighROE/HighGrowth/LowDebt/PositiveCashFlow/MainInflow/SustainedInflow/HighShortRatio/HighDividendLowValuation/WhiteHorseGrowth/Turnaround/SmallCapValue/TechFundamentalCombo。常用因子：PE_TTM/PB/PS_TTM/TotalMV/DividendRatioTTM（估值）· ROE/ROETTM/ROIC/GrossIncomeRatioTTM/NetProfitRatioTTM（盈利）· OperatingRevenueGrowRate/NPParentCompanyYOY（成长）· CurrentRatio/DebtAssetsRatio/NAPS（负债）· NetOperateCashFlowTTM（现金流）。用户问『筛选股票/符合条件的股票/低估高ROE』时用这个。",
        "operationId": "screen_v1_screen_get",
        "parameters": [
          {
            "name": "expr",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "因子表达式，如 intersect([PE_TTM > 0, PE_TTM < 20, ROETTM > 15])",
              "default": "",
              "title": "Expr"
            },
            "description": "因子表达式，如 intersect([PE_TTM > 0, PE_TTM < 20, ROETTM > 15])"
          },
          {
            "name": "preset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "预设名（与 expr 二选一）：LowPE/LowPB/HighDividend/PEG/HighROE 等 22 个",
              "default": "",
              "title": "Preset"
            },
            "description": "预设名（与 expr 二选一）：LowPE/LowPB/HighDividend/PEG/HighROE 等 22 个"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "返回条数，默认 20",
              "default": 20,
              "title": "Limit"
            },
            "description": "返回条数，默认 20"
          },
          {
            "name": "orderby",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "排序字段（如 ROETTM）",
              "default": "",
              "title": "Orderby"
            },
            "description": "排序字段（如 ROETTM）"
          },
          {
            "name": "desc",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "True 降序 / False 升序",
              "default": true,
              "title": "Desc"
            },
            "description": "True 降序 / False 升序"
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "市场：hs 沪深 / hk 港股 / us 美股（留空=沪深）",
              "default": "",
              "title": "Market"
            },
            "description": "市场：hs 沪深 / hk 港股 / us 美股（留空=沪深）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sector": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "板块行情榜",
        "description": "行业/概念/地域板块涨幅榜 + 领涨股。用户问『哪些板块在涨/板块轮动/行业热度』时用。",
        "operationId": "sector_v1_sector_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/industry-chain": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "产业链（主题/图谱/个股定位）",
        "description": "A 股产业链数据（**183 个产业链主题**）：mode=list 主题列表 · mode=graph&topic=超级电容 → **产业链图谱**（关联个股 + 所属节点 + 产业链位置 上游/中游/下游）· mode=stock&code=sh600667 → **个股所属产业链**（主题 / 节点 / 位置 / 关联度 / **业务描述**）。用户问『产业链/上下游/某公司处于链上什么位置/这个主题有哪些公司』时用。",
        "operationId": "industry_chain_v1_industry_chain_get",
        "parameters": [
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "list 主题列表 / graph 主题图谱 / stock 个股定位",
              "default": "graph",
              "title": "Mode"
            },
            "description": "list 主题列表 / graph 主题图谱 / stock 个股定位"
          },
          {
            "name": "topic",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "主题名（mode=graph）：如 超级电容 / 集成电路",
              "default": "",
              "title": "Topic"
            },
            "description": "主题名（mode=graph）：如 超级电容 / 集成电路"
          },
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "股票代码（mode=stock）：如 sh600667",
              "default": "",
              "title": "Code"
            },
            "description": "股票代码（mode=stock）：如 sh600667"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sector-valuation": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "板块估值（含历史百分位）",
        "description": "申万板块 PE/PB/PS/PCF + 股息率 + 历史百分位。code 形如 pt01801780。用户问『某板块贵不贵/估值分位』时用。",
        "operationId": "sector_valuation_v1_sector_valuation_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "申万板块代码：pt01801780",
              "title": "Code"
            },
            "description": "申万板块代码：pt01801780"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/macro": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "宏观数据",
        "description": "全球宏观指标：GDP/CPI/PMI/LPR/国债收益率/财政等。用户问『宏观/经济数据/利率/LPR/CPI』时用。",
        "operationId": "macro_v1_macro_get",
        "parameters": [
          {
            "name": "region",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "地区：cn 中国 / us 美国 / jp 日本 / eu 欧洲 / hk 香港",
              "default": "cn",
              "title": "Region"
            },
            "description": "地区：cn 中国 / us 美国 / jp 日本 / eu 欧洲 / hk 香港"
          },
          {
            "name": "names",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "指标短名（如 cn_gdp / cn_cpi_ppi / cn_lpr / us_inflation）；留空=该地区全套",
              "default": "",
              "title": "Names"
            },
            "description": "指标短名（如 cn_gdp / cn_cpi_ppi / cn_lpr / us_inflation）；留空=该地区全套"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/bond": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "可转债条款",
        "description": "可转债完整条款：溢价率、转股价值、双低值、强赎触发价、回售触发价、转股价、正股、到期日、信用评级。code 形如 sh113052。用户问『转债条款/强赎/双低/溢价』时用。",
        "operationId": "bond_v1_bond_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "可转债代码：sh113052 / sz123138",
              "title": "Code"
            },
            "description": "可转债代码：sh113052 / sz123138"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/etf": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "ETF 数据（概览/详情/持仓/净值/公司/持有人/财务）",
        "description": "ETF 行情/规模/溢折率/资金流。code 形如 sh510300。用户问『ETF』时用。`kind` 选子集：**概览**（默认，行情+规模+溢折率+资金流+回撤+估值） / 详情（基金要素+费率+份额） / 持仓（成分股及权重） / 净值（历史**单位净值**，4 位小数，**须同时传 `start`+`end`**；含 `closePrice` 可自算折溢价） / 公司（管理人+托管人+跟踪指数） / 持有人（户数+机构个人占比） / 财务（资产配置：股/债/商品/基金占比）。⚠️ 响应 `data` 是上游排版文本；**字段请取 `structured`（首表）或 `tables`（全部表）** —— `详情`/`公司` 是多表（含基金经理），只有 `tables` 能拿全。⚠️ **仅 ETF 代码**：传个股代码返回 `ok:false`（**不扣次数**），不再给全 0 空壳 —— 代码不确定请先用 `/v1/search` 或 `/v1/hot?type=etf` 确认。⚠️ 代码可传裸 6 位 `510300` 或带前缀 `sh510300`，结果一致。",
        "operationId": "etf_v1_etf_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ETF 代码：sh510300",
              "title": "Code"
            },
            "description": "ETF 代码：sh510300"
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "概览(默认)/详情/持仓/净值/公司/持有人/财务",
              "default": "概览",
              "title": "Kind"
            },
            "description": "概览(默认)/详情/持仓/净值/公司/持有人/财务"
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "仅 kind=净值：起始日 YYYY-MM-DD",
              "default": "",
              "title": "Start"
            },
            "description": "仅 kind=净值：起始日 YYYY-MM-DD"
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "仅 kind=净值：结束日 YYYY-MM-DD",
              "default": "",
              "title": "End"
            },
            "description": "仅 kind=净值：结束日 YYYY-MM-DD"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ipo": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "新股日历",
        "description": "新股发行/申购/中签/上市日历。用户问『新股/打新/IPO』时用。",
        "operationId": "ipo_v1_ipo_get",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "查询天数，默认 15",
              "default": 15,
              "title": "Days"
            },
            "description": "查询天数，默认 15"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dividend": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "分红送转",
        "description": "分红送转历史（每股分红/送股/除权日）。",
        "operationId": "dividend_v1_dividend_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "股票代码：sh600667",
              "title": "Code"
            },
            "description": "股票代码：sh600667"
          },
          {
            "name": "years",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "年数，默认 3",
              "default": 3,
              "title": "Years"
            },
            "description": "年数，默认 3"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dehydrated": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "脱水研报",
        "description": "券商研报脱水摘要。用户问『研报/机构观点/券商怎么说』时用。",
        "operationId": "dehydrated_v1_dehydrated_get",
        "parameters": [
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "list 列表 / detail 详情",
              "default": "list",
              "title": "Mode"
            },
            "description": "list 列表 / detail 详情"
          },
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "股票代码（detail 时用）",
              "default": "",
              "title": "Symbol"
            },
            "description": "股票代码（detail 时用）"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "条数，默认 10",
              "default": 10,
              "title": "Limit"
            },
            "description": "条数，默认 10"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/profile": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "公司简况",
        "description": "公司基本信息：上市日期、主营业务、所属行业。",
        "operationId": "profile_v1_profile_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "股票代码：sh600667",
              "title": "Code"
            },
            "description": "股票代码：sh600667"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/search": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "股票搜索（模糊词消歧）",
        "description": "按名称/代码搜索股票、基金、板块。用户只给名称时**先用这个确认代码**。",
        "operationId": "search_v1_search_get",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "关键词：'太极实业' 或 '600667'",
              "title": "Q"
            },
            "description": "关键词：'太极实业' 或 '600667'"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/calendar": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "投资日历（个股事件）",
        "description": "**个股事件日历**：分红派息 / 解禁 / 财报披露等公司事件排期（不是宏观数据日历——宏观请用 /v1/macro）。\n\n⚠️ data 是【多段结构】：data.tables 是**表列表**（按事件类型分段，保序），每段含 title（中文标题）/ slug（英文键）/ rows；另有 data.data{slug: rows} 便捷索引。常见 slug：financial_report 财报发布 · dividend 分红派息 · ipo 新股发行 · meeting 会议 · lockup_release 限售解禁 · rights_issue 增发。",
        "operationId": "calendar_v1_calendar_get",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "窗口起始日 YYYY-MM-DD（留空=今天起）；返回该日起约 1 个月的个股事件",
              "default": "",
              "title": "Date"
            },
            "description": "窗口起始日 YYYY-MM-DD（留空=今天起）；返回该日起约 1 个月的个股事件"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "返回规模（透传上游；上游按事件类型分段，各段条数不严格等于该值）",
              "default": 20,
              "title": "Limit"
            },
            "description": "返回规模（透传上游；上游按事件类型分段，各段条数不严格等于该值）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/margin-trade": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "融资融券",
        "description": "个股融资融券明细：融资余额、买入、偿还、融券。**code 必填**（支持批量：`sh600667,sz000651`）；缺 code 会返回明确的说明（不再静默空）；未披露交易日的两融数据上游会给出原因。",
        "operationId": "margin_trade_v1_margin_trade_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "股票代码（支持批量逗号分隔）：sh600667 或 sh600667,sz000651",
              "default": "",
              "title": "Code"
            },
            "description": "股票代码（支持批量逗号分隔）：sh600667 或 sh600667,sz000651"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "日期 YYYY-MM-DD（留空=最近已披露交易日）",
              "default": "",
              "title": "Date"
            },
            "description": "日期 YYYY-MM-DD（留空=最近已披露交易日）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/block-trade": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "大宗交易",
        "description": "大宗交易记录：成交价、折溢价、成交量、买卖方营业部。",
        "operationId": "block_trade_v1_block_trade_get",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "股票代码：sh600667",
              "default": "",
              "title": "Code"
            },
            "description": "股票代码：sh600667"
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "日期 YYYY-MM-DD（留空=最近）",
              "default": "",
              "title": "Date"
            },
            "description": "日期 YYYY-MM-DD（留空=最近）"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "tags": [
          "pro"
        ],
        "summary": "查询用量与额度",
        "description": "查当前 Key 的今日调用次数、总量剩余（买断档）、到期时间（订阅档）与限流额度。",
        "operationId": "usage_v1_usage_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  }
}