Files
shaguabijia-app-server/docs/api/meituan/meituan-top-sales.md
guke a563c1ca4b @ (#111)
docs/api目录文档分类和补全

---------

Co-authored-by: guke <guke@autohome.com.cn>
Reviewed-on: #111
2026-07-03 15:00:37 +08:00

1.5 KiB
Raw Permalink Blame History

POST /api/v1/meituan/top-sales — 销量最高(离线库)

所属:美团 CPS 组(前缀 /api/v1/meituan,全部无鉴权) | 鉴权:无 | ← 返回 API 索引

数据来自离线库 database/meituan_coupon;不实时打美团(美团搜索对销量排序支持差、且有 402 限流)。

入参

字段 类型 必填 默认 说明
page int 1 ≥1
page_size int 20 150
platform int | null null 1 只外卖 / 2 只到店 / 不填=全部(全城销量)

出参

响应 200:{ items: CouponCard[], has_next: bool, search_id: null, status: "ok"|"empty"|"degraded" }CouponCardAPI 索引;status 语义见 feed 接口

说明

  • meituan_couponsale_volume_num 非空的券,DISTINCT ON(dedup_key) 跨源去重(每个「品牌|名|价」只留销量最高一条,同销量再按佣金),按销量降序分页;每页只对当前 ~20 条做 from_raw 解析(翻页快,不全表拉取)。
  • 不依赖 MT 凭证(纯库查询)。库为空(prod 刚部署 / ETL 未跑完)→ status=empty;库查询异常 → status=degraded。均返 200、不抛 5xx。
  • 仅 PostgreSQL(DISTINCT ON 为 PG 专用)。

错误码

无业务级错误码:库空 / 异常都返 200 + 空 items + 对应 status