{
    "openapi": "3.1.0",
    "x-derived-from": "/api/v1/meta（能力表 abilities 单源派生；meta 增删端点本契约自动跟随）",
    "x-api-version": "v1",
    "info": {
        "title": "线报酷开放 API v1（xianbao.fun）",
        "version": "1.0.0",
        "description": "线报酷（xianbao.fun）开放 API v1 的机读契约（OpenAPI 3.1），公开只读、无需密钥。\n\n【分发面】\n- 本契约（openapi.json）：REST 机读描述，GPTs Actions / Coze / Dify 等平台可直接导入；\n- MCP：POST /api/mcp（JSON-RPC 2.0，12 个只读工具，30 次/分/IP）——与本契约并列的另一个分发面；\n- 能力自描述：GET /api/v1/meta（本契约的端点清单由其 abilities 单源派生）；\n- 人类接入页：https://new.xianbao.fun/agent.html ；llms.txt：https://new.xianbao.fun/llms.txt\n\n【限流】每 IP 每接口 60 次/分，超限 429 + Retry-After；支持跨域（Access-Control-Allow-Origin: *）。\n\n【口径】\n- 时间字段 published_at 为 Unix 秒；价格字段为数字或 null（null=无价，与 0 元不同）；\n- 只读字段只增不减；破坏性变更通过 /api/v2 提供；\n\n【明确不提供】\n- SSE 实时推送流：长连接会独占服务端进程，不对外开放\n- 状态投票（仍有效/已失效）：写接口，不对外开放（文章详情接口只读返回共识结论 status_consensus）\n- 生活优惠转链跳转：转链结果在 /api/v1/shenghuo 的 h5 字段中已提供\n- 用户筛选规则（rules）：属于登录用户私有配置，公开接口不适用"
    },
    "externalDocs": {
        "url": "https://new.xianbao.fun/docs/api.html",
        "description": "人类可读 API 文档"
    },
    "servers": [
        {
            "url": "https://new.xianbao.fun",
            "description": "按请求方域名动态生成（镜像域名 new.ixbk.net 等同样可用）"
        }
    ],
    "tags": [
        {
            "name": "meta",
            "description": "能力自描述"
        },
        {
            "name": "feed",
            "description": "线报流"
        },
        {
            "name": "articles",
            "description": "文章"
        },
        {
            "name": "search",
            "description": "搜索"
        },
        {
            "name": "rank",
            "description": "榜单"
        },
        {
            "name": "shenghuo",
            "description": "生活优惠"
        },
        {
            "name": "price",
            "description": "价格判定"
        }
    ],
    "paths": {
        "/api/v1/rank": {
            "get": {
                "tags": [
                    "rank"
                ],
                "summary": "热门榜单（13 个时间窗口）",
                "description": "与站内榜单页同源。act 可用值由 /api/v1/meta 的 abilities.rank.ranks 单源派生（本契约的 schema enum 同步该清单）。榜单条目不含浏览量（站内经营数据不下发）。",
                "operationId": "getHotRank",
                "parameters": [
                    {
                        "name": "act",
                        "in": "query",
                        "required": true,
                        "description": "榜单类型（13 窗口，见 enum；完整语义见 /api/v1/meta）",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "yixiaoshi",
                                "sanxiaoshi",
                                "liuxiaoshi",
                                "shierxiaoshi",
                                "ershisixiaoshi",
                                "sishibaxiaoshi",
                                "jintian",
                                "zuotian",
                                "qiantian",
                                "santian",
                                "wutian",
                                "qitian",
                                "shiwutian"
                            ]
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "返回条数",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 300,
                            "default": 20
                        }
                    },
                    {
                        "name": "with_html",
                        "in": "query",
                        "required": false,
                        "description": "每条附 content_html（展示态富文本；图片已防盗链改写；单响应总预算 4MB，超出标记 meta.html_truncated=true）（传 1 启用）",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "1"
                            ],
                            "default": "0"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功（信封 code=0）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "code": {
                                            "type": "integer",
                                            "description": "0=成功；业务失败走 HTTP 状态码（body 的 code 同 HTTP 码）"
                                        },
                                        "msg": {
                                            "type": "string",
                                            "description": "人类可读说明；成功时为空串"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "act": {
                                                    "type": "string"
                                                },
                                                "count": {
                                                    "type": "integer"
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/RankItem"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "api_version": {
                                                    "type": "string",
                                                    "description": "API 版本（v1）"
                                                },
                                                "generated_at": {
                                                    "type": "integer",
                                                    "description": "响应生成时间 Unix 秒"
                                                }
                                            },
                                            "additionalProperties": true
                                        }
                                    },
                                    "required": [
                                        "code",
                                        "msg",
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "缺 act（error=missing_act）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "未知榜单 act（error=unknown_act）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "请求过于频繁（60 次/分/IP）",
                        "headers": {
                            "Retry-After": {
                                "schema": {
                                    "type": "integer"
                                },
                                "description": "建议等待秒数（窗口重置时间差）"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/feed": {
            "get": {
                "tags": [
                    "feed"
                ],
                "summary": "分类流 / 全站流 / 值得买独立流",
                "description": "数据源为发文钩子写好的静态 JSON（全站/分类容量 20 条，值得买 30 条）。type=zdm 为值得买独立流（异构结构，条目见 ZdmItem）；否则为分类流（条目见 FeedItem）。",
                "operationId": "getDealFeed",
                "parameters": [
                    {
                        "name": "cate",
                        "in": "query",
                        "required": false,
                        "description": "分类别名或 ID，缺省=all（全站流）；可用值见 /api/v1/meta 的 abilities.feed.categories",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "description": "填 zdm 取值得买独立流（异构结构）",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "zdm"
                            ]
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "返回条数",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 50,
                            "default": 20
                        }
                    },
                    {
                        "name": "with_html",
                        "in": "query",
                        "required": false,
                        "description": "每条附 content_html（展示态富文本；图片已防盗链改写；单响应总预算 4MB，超出标记 meta.html_truncated=true）；值得买流无正文，不适用（传 1 启用）",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "1"
                            ],
                            "default": "0"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功（信封 code=0）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "code": {
                                            "type": "integer",
                                            "description": "0=成功；业务失败走 HTTP 状态码（body 的 code 同 HTTP 码）"
                                        },
                                        "msg": {
                                            "type": "string",
                                            "description": "人类可读说明；成功时为空串"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "type": {
                                                    "type": "string",
                                                    "description": "post=分类流；zdm=值得买流"
                                                },
                                                "label": {
                                                    "type": "string",
                                                    "description": "仅值得买流：值得买"
                                                },
                                                "category": {
                                                    "type": "object",
                                                    "description": "请求的分类（all=全站）",
                                                    "additionalProperties": true
                                                },
                                                "count": {
                                                    "type": "integer"
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "description": "分类流条目（FeedItem）或值得买条目（ZdmItem，仅 type=zdm）",
                                                        "oneOf": [
                                                            {
                                                                "$ref": "#/components/schemas/FeedItem"
                                                            },
                                                            {
                                                                "$ref": "#/components/schemas/ZdmItem"
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "api_version": {
                                                    "type": "string",
                                                    "description": "API 版本（v1）"
                                                },
                                                "generated_at": {
                                                    "type": "integer",
                                                    "description": "响应生成时间 Unix 秒"
                                                }
                                            },
                                            "additionalProperties": true
                                        }
                                    },
                                    "required": [
                                        "code",
                                        "msg",
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "未知或不对外开放的分类（error=unknown_category）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "请求过于频繁（60 次/分/IP）",
                        "headers": {
                            "Retry-After": {
                                "schema": {
                                    "type": "integer"
                                },
                                "description": "建议等待秒数（窗口重置时间差）"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "数据源暂不可用（error=source_unavailable）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/articles": {
            "get": {
                "tags": [
                    "articles"
                ],
                "summary": "分页公开文章列表",
                "description": "仅公开普通文章（log_Type=0, log_Status=0），按发布时间倒序。author=楼主昵称整名精确过滤（20261125 author 批次；与 search 的 author 同口径）。",
                "operationId": "listArticles",
                "parameters": [
                    {
                        "name": "cate",
                        "in": "query",
                        "required": false,
                        "description": "公开分类别名或 ID（可选；传空值返回 400；未知分类返回 404）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "author",
                        "in": "query",
                        "required": false,
                        "description": "楼主昵称（整名精确，可选；与 search 的 author 同口径）",
                        "schema": {
                            "type": "string",
                            "maxLength": 100
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "页码",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 1
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "每页条数",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 50,
                            "default": 20
                        }
                    },
                    {
                        "name": "since",
                        "in": "query",
                        "required": false,
                        "description": "发布时间下界 Unix 秒（含）",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "until",
                        "in": "query",
                        "required": false,
                        "description": "发布时间上界 Unix 秒（含）",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功（信封 code=0）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "code": {
                                            "type": "integer",
                                            "description": "0=成功；业务失败走 HTTP 状态码（body 的 code 同 HTTP 码）"
                                        },
                                        "msg": {
                                            "type": "string",
                                            "description": "人类可读说明；成功时为空串"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "page": {
                                                    "type": "integer"
                                                },
                                                "limit": {
                                                    "type": "integer"
                                                },
                                                "count": {
                                                    "type": "integer"
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/ArticleListItem"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "api_version": {
                                                    "type": "string",
                                                    "description": "API 版本（v1）"
                                                },
                                                "generated_at": {
                                                    "type": "integer",
                                                    "description": "响应生成时间 Unix 秒"
                                                }
                                            },
                                            "additionalProperties": true
                                        }
                                    },
                                    "required": [
                                        "code",
                                        "msg",
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "cate 为空（invalid_category）或 since>until（invalid_time_range）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "未知或未对外开放的分类（error=unknown_category）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "请求过于频繁（60 次/分/IP）",
                        "headers": {
                            "Retry-After": {
                                "schema": {
                                    "type": "integer"
                                },
                                "description": "建议等待秒数（窗口重置时间差）"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/article": {
            "get": {
                "tags": [
                    "articles"
                ],
                "summary": "单篇公开文章详情",
                "description": "含正文纯文本；可选展示态富文本（with_html=1）与失效共识字段 status_consensus（≥3 票且六成共识才输出）。",
                "operationId": "getArticle",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "required": true,
                        "description": "必填文章 ID",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "with_html",
                        "in": "query",
                        "required": false,
                        "description": "附清洗后的 content_html（白名单清洗的展示态富文本）（传 1 启用）",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "1"
                            ],
                            "default": "0"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功（信封 code=0）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "code": {
                                            "type": "integer",
                                            "description": "0=成功；业务失败走 HTTP 状态码（body 的 code 同 HTTP 码）"
                                        },
                                        "msg": {
                                            "type": "string",
                                            "description": "人类可读说明；成功时为空串"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "article": {
                                                    "$ref": "#/components/schemas/ArticleDetail"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "api_version": {
                                                    "type": "string",
                                                    "description": "API 版本（v1）"
                                                },
                                                "generated_at": {
                                                    "type": "integer",
                                                    "description": "响应生成时间 Unix 秒"
                                                }
                                            },
                                            "additionalProperties": true
                                        }
                                    },
                                    "required": [
                                        "code",
                                        "msg",
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "缺 id 或非正整数（error=missing_id）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "文章不存在或未公开（error=article_not_found）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "正文超过公开接口单篇处理上限（error=content_too_large）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "请求过于频繁（60 次/分/IP）",
                        "headers": {
                            "Retry-After": {
                                "schema": {
                                    "type": "integer"
                                },
                                "description": "建议等待秒数（窗口重置时间差）"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "文章数据暂不可用（error=source_unavailable）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/search": {
            "get": {
                "tags": [
                    "search"
                ],
                "summary": "关键词 + 价格区间搜索（OR 语义）",
                "description": "召回与站内搜索页同源（ES）。q 多词用换行/|/# 分隔（OR 语义；与网页搜索框的空格 AND 不同）。价格筛选仅覆盖微博线报/好单线报（cate 10/30）；值得买独立流不在此检索，走 /api/v1/feed?type=zdm。q/kp/mip/mxp/author 至少提供一个。author=楼主昵称整名精确过滤（20261125 author 批次，term author.raw，与站内筛选「楼主」同口径）。",
                "operationId": "searchDeals",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "关键词，多词用换行/|/# 分隔（OR 语义）",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    },
                    {
                        "name": "kp",
                        "in": "query",
                        "required": false,
                        "description": "屏蔽词（命中即排除）",
                        "schema": {
                            "type": "string",
                            "maxLength": 200
                        }
                    },
                    {
                        "name": "mip",
                        "in": "query",
                        "required": false,
                        "description": "最低价",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "mxp",
                        "in": "query",
                        "required": false,
                        "description": "最高价",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "cate",
                        "in": "query",
                        "required": false,
                        "description": "限定分类别名或 ID（可选）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "author",
                        "in": "query",
                        "required": false,
                        "description": "楼主昵称（整名精确，可选；与站内筛选「楼主」同口径）",
                        "schema": {
                            "type": "string",
                            "maxLength": 100
                        }
                    },
                    {
                        "name": "since",
                        "in": "query",
                        "required": false,
                        "description": "发布时间下界 Unix 秒（可选，含；与 articles 的 since 同口径）",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "until",
                        "in": "query",
                        "required": false,
                        "description": "发布时间上界 Unix 秒（可选，含；since>until → 400）",
                        "schema": {
                            "type": "integer",
                            "minimum": 0
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "页码",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 1
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "每页条数",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 50,
                            "default": 20
                        }
                    },
                    {
                        "name": "with_html",
                        "in": "query",
                        "required": false,
                        "description": "每条附 content_html（展示态富文本；图片已防盗链改写；单响应总预算 4MB，超出标记 meta.html_truncated=true）（传 1 启用）",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "1"
                            ],
                            "default": "0"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功（信封 code=0）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "code": {
                                            "type": "integer",
                                            "description": "0=成功；业务失败走 HTTP 状态码（body 的 code 同 HTTP 码）"
                                        },
                                        "msg": {
                                            "type": "string",
                                            "description": "人类可读说明；成功时为空串"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "query": {
                                                    "type": "object",
                                                    "description": "回显本次生效的查询条件",
                                                    "additionalProperties": true
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "page": {
                                                    "type": "integer"
                                                },
                                                "count": {
                                                    "type": "integer"
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/SearchItem"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "api_version": {
                                                    "type": "string",
                                                    "description": "API 版本（v1）"
                                                },
                                                "generated_at": {
                                                    "type": "integer",
                                                    "description": "响应生成时间 Unix 秒"
                                                }
                                            },
                                            "additionalProperties": true
                                        }
                                    },
                                    "required": [
                                        "code",
                                        "msg",
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "无任何查询条件（missing_query）/ mip>mxp（invalid_price_range）/ since>until（invalid_time_range）/ cate 为空（invalid_category）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "未知或未对外开放的分类（error=unknown_category）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "请求过于频繁（60 次/分/IP）",
                        "headers": {
                            "Retry-After": {
                                "schema": {
                                    "type": "integer"
                                },
                                "description": "建议等待秒数（窗口重置时间差）"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "搜索内核不可用（error=search_unavailable）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/shenghuo": {
            "get": {
                "tags": [
                    "shenghuo"
                ],
                "summary": "生活优惠列表",
                "description": "与站内生活优惠页同源（分页/脱敏/下架过滤同口径）。h5 字段即转链地址（不另提供转链接口）。",
                "operationId": "listLifeOffers",
                "parameters": [
                    {
                        "name": "cate",
                        "in": "query",
                        "required": false,
                        "description": "活动分类（可选；分类清单用 with_cates=1 获取）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "关键词（可选）",
                        "schema": {
                            "type": "string",
                            "maxLength": 100
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "页码",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 500,
                            "default": 1
                        }
                    },
                    {
                        "name": "pageSize",
                        "in": "query",
                        "required": false,
                        "description": "每页条数",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 20
                        }
                    },
                    {
                        "name": "with_cates",
                        "in": "query",
                        "required": false,
                        "description": "额外返回 cates 分类清单（传 1 启用）",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "1"
                            ],
                            "default": "0"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功（信封 code=0）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "code": {
                                            "type": "integer",
                                            "description": "0=成功；业务失败走 HTTP 状态码（body 的 code 同 HTTP 码）"
                                        },
                                        "msg": {
                                            "type": "string",
                                            "description": "人类可读说明；成功时为空串"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "page": {
                                                    "type": "integer"
                                                },
                                                "page_size": {
                                                    "type": "integer"
                                                },
                                                "count": {
                                                    "type": "integer"
                                                },
                                                "has_more": {
                                                    "type": "boolean"
                                                },
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/ShenghuoItem"
                                                    }
                                                },
                                                "cates": {
                                                    "type": "array",
                                                    "description": "仅 with_cates=1 时出现",
                                                    "items": null
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "api_version": {
                                                    "type": "string",
                                                    "description": "API 版本（v1）"
                                                },
                                                "generated_at": {
                                                    "type": "integer",
                                                    "description": "响应生成时间 Unix 秒"
                                                }
                                            },
                                            "additionalProperties": true
                                        }
                                    },
                                    "required": [
                                        "code",
                                        "msg",
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "请求过于频繁（60 次/分/IP）",
                        "headers": {
                            "Retry-After": {
                                "schema": {
                                    "type": "integer"
                                },
                                "description": "建议等待秒数（窗口重置时间差）"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "生活优惠服务未加载或数据源暂不可用（error=source_unavailable）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/price": {
            "get": {
                "tags": [
                    "price"
                ],
                "summary": "价格判定（id 精确五档 / title 模糊候选）",
                "description": "与文章页价格卡完全同口径（90 天窗口、单位价基准）。id= 走精确链路返回五档判定（best/near/good/flat/high，样本不足 insufficient）；title= 返回模糊候选组（每组带组口径判定 caliber=group，不做单文精确判定），候选带 aid/url 可直接引用或再走 id 精判。仅覆盖微博线报（cate=10）与好单线报（cate=30）。",
                "operationId": "checkPrice",
                "parameters": [
                    {
                        "name": "id",
                        "in": "query",
                        "required": false,
                        "description": "文章 ID（与 title 二选一；返回五档判定）",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "required": false,
                        "description": "商品标题关键词（与 id 二选一；模糊候选组，每组带组口径判定；超 60 字截断）",
                        "schema": {
                            "type": "string",
                            "maxLength": 60
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "title 模式候选组数",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 10,
                            "default": 5
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功（信封 code=0）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "code": {
                                            "type": "integer",
                                            "description": "0=成功；业务失败走 HTTP 状态码（body 的 code 同 HTTP 码）"
                                        },
                                        "msg": {
                                            "type": "string",
                                            "description": "人类可读说明；成功时为空串"
                                        },
                                        "data": {
                                            "oneOf": [
                                                {
                                                    "$ref": "#/components/schemas/PriceVerdict"
                                                },
                                                {
                                                    "$ref": "#/components/schemas/PriceCandidate"
                                                }
                                            ],
                                            "description": "id 模式=PriceVerdict；title 模式=PriceCandidates（二选一入参决定形态）"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "api_version": {
                                                    "type": "string",
                                                    "description": "API 版本（v1）"
                                                },
                                                "generated_at": {
                                                    "type": "integer",
                                                    "description": "响应生成时间 Unix 秒"
                                                }
                                            },
                                            "additionalProperties": true
                                        }
                                    },
                                    "required": [
                                        "code",
                                        "msg",
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "id/title 均未提供（missing_query）/ id 非法（missing_id）/ 文章分类不在价格覆盖范围（price_not_applicable）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "文章不存在或未公开（error=article_not_found）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "请求过于频繁（60 次/分/IP）",
                        "headers": {
                            "Retry-After": {
                                "schema": {
                                    "type": "integer"
                                },
                                "description": "建议等待秒数（窗口重置时间差）"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "价格服务未加载（error=price_unavailable）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/meta": {
            "get": {
                "tags": [
                    "meta"
                ],
                "summary": "能力自描述（端点/参数/榜单/分类/限流/不提供项）",
                "description": "本 API 的能力清单，客户端据此做能力探测与参数校验。openapi.json 的端点清单由其 abilities 节单源派生。",
                "operationId": "getApiMeta",
                "parameters": [],
                "responses": {
                    "200": {
                        "description": "成功（信封 code=0）",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "code": {
                                            "type": "integer",
                                            "description": "0=成功；业务失败走 HTTP 状态码（body 的 code 同 HTTP 码）"
                                        },
                                        "msg": {
                                            "type": "string",
                                            "description": "人类可读说明；成功时为空串"
                                        },
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "abilities": {
                                                    "type": "object",
                                                    "description": "各端点参数说明（rank/feed/articles/article/search/shenghuo/price）",
                                                    "additionalProperties": true
                                                },
                                                "mcp": {
                                                    "type": "object",
                                                    "description": "MCP 端点（/api/mcp，JSON-RPC 2.0，12 只读工具，30 次/分/IP）——与本契约并列的另一个分发面（工具数与 meta_payload.php mcp 节同步；20261126 二刀 +hot_keywords）",
                                                    "additionalProperties": true
                                                },
                                                "openapi": {
                                                    "type": "object",
                                                    "description": "本机读契约的登记信息",
                                                    "additionalProperties": true
                                                },
                                                "not_provided": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "additionalProperties": true
                                                    },
                                                    "description": "明确不提供的能力（避免误用）"
                                                },
                                                "with_html": {
                                                    "type": "object",
                                                    "additionalProperties": true
                                                },
                                                "rate_limit": {
                                                    "type": "object",
                                                    "additionalProperties": true
                                                },
                                                "notes": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "api_version": {
                                                    "type": "string",
                                                    "description": "API 版本（v1）"
                                                },
                                                "generated_at": {
                                                    "type": "integer",
                                                    "description": "响应生成时间 Unix 秒"
                                                }
                                            },
                                            "additionalProperties": true
                                        }
                                    },
                                    "required": [
                                        "code",
                                        "msg",
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "请求过于频繁（60 次/分/IP）",
                        "headers": {
                            "Retry-After": {
                                "schema": {
                                    "type": "integer"
                                },
                                "description": "建议等待秒数（窗口重置时间差）"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "integer",
                        "description": "同 HTTP 状态码"
                    },
                    "error": {
                        "type": "string",
                        "description": "机器可读错误码（如 missing_id / unknown_act / rate_limited）"
                    },
                    "msg": {
                        "type": "string",
                        "description": "人类可读说明"
                    }
                },
                "required": [
                    "code",
                    "error",
                    "msg"
                ]
            },
            "Category": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "alias": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    }
                },
                "additionalProperties": true
            },
            "FeedItem": {
                "type": "object",
                "description": "分类流/全站流条目（type=zdm 时为 ZdmItem，异构结构）",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "content": {
                        "type": "string",
                        "description": "转链 HTML 或正文摘要"
                    },
                    "url": {
                        "type": "string",
                        "description": "站内文章绝对地址"
                    },
                    "category": {
                        "$ref": "#/components/schemas/Category"
                    },
                    "price": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "数字或 null（null=无价，与 0 元不同）"
                    },
                    "published_at": {
                        "type": "integer",
                        "description": "Unix 秒"
                    },
                    "published_text": {
                        "type": "string"
                    },
                    "author": {
                        "type": "string"
                    },
                    "comments": {
                        "type": "integer"
                    }
                },
                "additionalProperties": true
            },
            "ZdmItem": {
                "type": "object",
                "description": "值得买独立流条目（type=zdm；url 指向站外 smzdm.com）",
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "该流 ID 字段名为 yid（字符串）"
                    },
                    "type": {
                        "type": "string",
                        "description": "来源类型（smzdm 等）"
                    },
                    "title": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "description": "站外原链"
                    },
                    "price": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "数字或 null（null=无价，与 0 元不同）"
                    },
                    "brand": {
                        "type": "string"
                    },
                    "mall": {
                        "type": "string"
                    },
                    "category_name": {
                        "type": "string"
                    },
                    "pic": {
                        "type": "string"
                    },
                    "published_at": {
                        "type": "integer"
                    }
                },
                "additionalProperties": true
            },
            "RankItem": {
                "type": "object",
                "description": "榜单条目（limit>50 时额外带 content 纯文本）",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string"
                    },
                    "category": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": true
                    },
                    "published_at": {
                        "type": "integer"
                    },
                    "published_text": {
                        "type": "string"
                    },
                    "author": {
                        "type": "string"
                    },
                    "comments": {
                        "type": "integer"
                    }
                },
                "additionalProperties": true
            },
            "ArticleListItem": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string"
                    },
                    "category": {
                        "$ref": "#/components/schemas/Category"
                    },
                    "author": {
                        "type": "string"
                    },
                    "published_at": {
                        "type": "integer"
                    },
                    "updated_at": {
                        "type": "integer"
                    },
                    "comments": {
                        "type": "integer"
                    },
                    "excerpt": {
                        "type": "string",
                        "description": "纯文本摘要"
                    }
                },
                "additionalProperties": true
            },
            "ArticleDetail": {
                "type": "object",
                "description": "仅公开普通文章（log_Type=0, log_Status=0）；with_html=1 时附 content_html；失效共识 status_consensus（valid/invalid/soldout）只在 ≥3 票且六成共识时出现（按 isset 判断）",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string"
                    },
                    "category": {
                        "$ref": "#/components/schemas/Category"
                    },
                    "author": {
                        "type": "string"
                    },
                    "published_at": {
                        "type": "integer"
                    },
                    "updated_at": {
                        "type": "integer"
                    },
                    "comments": {
                        "type": "integer"
                    },
                    "excerpt": {
                        "type": "string"
                    },
                    "content": {
                        "type": "string",
                        "description": "清洗后的正文纯文本"
                    },
                    "status_consensus": {
                        "type": "string",
                        "enum": [
                            "valid",
                            "invalid",
                            "soldout"
                        ],
                        "description": "可选；共识成立才输出"
                    },
                    "status_consensus_label": {
                        "type": "string"
                    },
                    "content_html": {
                        "type": "string",
                        "description": "可选；with_html=1 时输出（白名单清洗的展示态富文本）"
                    }
                },
                "additionalProperties": true
            },
            "SearchItem": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string"
                    },
                    "category": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "price": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "数字或 null（null=无价，与 0 元不同）"
                    },
                    "published_at": {
                        "type": "integer"
                    },
                    "author": {
                        "type": "string"
                    }
                },
                "additionalProperties": true
            },
            "ShenghuoItem": {
                "type": "object",
                "properties": {
                    "act_id": {
                        "type": "integer"
                    },
                    "act_name": {
                        "type": "string"
                    },
                    "cate_name": {
                        "type": "string"
                    },
                    "desc": {
                        "type": "string"
                    },
                    "img": {
                        "type": "string"
                    },
                    "icon": {
                        "type": "string"
                    },
                    "start_date": {
                        "type": "string"
                    },
                    "end_date": {
                        "type": "string"
                    },
                    "h5": {
                        "type": "string",
                        "description": "转链地址（生活优惠转链的唯一出口）"
                    }
                },
                "additionalProperties": true
            },
            "PriceVerdict": {
                "type": "object",
                "description": "price?id= 模式输出（与文章页价格卡同口径：90 天窗口、单位价基准）",
                "properties": {
                    "article": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "title": {
                                "type": "string"
                            },
                            "cate_id": {
                                "type": "integer"
                            },
                            "url": {
                                "type": "string"
                            }
                        },
                        "additionalProperties": true
                    },
                    "price": {
                        "description": "当前价：数字（no_price/unparseable 早期返回，null=无价）或统计对象（最终判定）",
                        "oneOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "current": {
                                        "type": "number"
                                    },
                                    "current_unit": {
                                        "type": "number"
                                    },
                                    "basis": {
                                        "type": "string",
                                        "description": "单件/套件基准"
                                    },
                                    "basis_label": {
                                        "type": "string"
                                    },
                                    "min_90d_unit": {
                                        "type": "number"
                                    },
                                    "median_90d_unit": {
                                        "type": "number"
                                    },
                                    "sample_points": {
                                        "type": "integer"
                                    },
                                    "sample_days": {
                                        "type": "integer"
                                    },
                                    "window_days": {
                                        "type": "integer"
                                    },
                                    "oldest_point_at": {
                                        "type": "integer"
                                    },
                                    "newest_point_at": {
                                        "type": "integer"
                                    }
                                },
                                "additionalProperties": true
                            }
                        ]
                    },
                    "verdict": {
                        "type": "string",
                        "enum": [
                            "best",
                            "near",
                            "good",
                            "flat",
                            "high",
                            "insufficient",
                            "no_price",
                            "unparseable"
                        ],
                        "description": "best 历史低位 / near 接近低位 / good 近期偏便宜 / flat 价格平稳 / high 高于近期 / insufficient 样本不足 / no_price 无当前价 / unparseable 标题不可解析"
                    },
                    "verdict_label": {
                        "type": "string"
                    },
                    "note": {
                        "type": "string"
                    }
                },
                "required": [
                    "article",
                    "verdict",
                    "verdict_label"
                ]
            },
            "PriceCandidate": {
                "type": "object",
                "description": "price?title= 模式的候选组（caliber=group 组口径；精确判定请对具体文章用 id）",
                "properties": {
                    "norm": {
                        "type": "string",
                        "description": "归一商品键"
                    },
                    "source": {
                        "type": "string",
                        "enum": [
                            "haodan_or_weibo",
                            "smzdm",
                            "manmanmai"
                        ]
                    },
                    "title_sample": {
                        "type": "string"
                    },
                    "last_price": {
                        "type": "number",
                        "description": "组内最新价"
                    },
                    "last_point_at": {
                        "type": "integer"
                    },
                    "points_total": {
                        "type": "integer"
                    },
                    "decidable_hint": {
                        "type": "boolean",
                        "description": "点数是否达到判定下限（≥3）"
                    },
                    "verdict": {
                        "type": "string",
                        "description": "组口径五档或 insufficient"
                    },
                    "verdict_label": {
                        "type": "string"
                    },
                    "caliber": {
                        "type": "string",
                        "description": "group=候选组口径（比文章页单文口径宽）"
                    }
                },
                "additionalProperties": true
            }
        }
    }
}