---
title: "获取公众号文章互动数据（H5 版本）/Get WeChat MP Article Stats (H5)"
method: POST
path: "/api/v1/wechat_mp/v2/fetch_article_stats_h5"
tags: ["WeChat-Media-Platform-V2-API"]
---

# 获取公众号文章互动数据（H5 版本）/Get WeChat MP Article Stats (H5)

`POST /api/v1/wechat_mp/v2/fetch_article_stats_h5`

## Request

- Base URL: `https://api.tikhub.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.tikhub.io/api/v1/wechat_mp/v2/fetch_article_stats_h5`
- Auth: HTTP bearer

# [中文]
### 用途:
- 传文章 URL，返回**评论数 / 精选评论数**。与 `/fetch_article_stats` 是**两个独立接口**，
  各自返回结果，不会自动切换：

    | 接口 | 能取到 | 建议 |
    |---|---|---|
    | `/fetch_article_stats` | 阅读量 / 点赞 / 在看 / 分享 / 收藏 / 评论数（**全部指标**） | 需要阅读量等指标时用 |
    | `/fetch_article_stats_h5`（本接口） | **仅评论数 / 精选评论数**；稳定性更好 | 只要评论数、或上面那条报错时用 |

- ⚠️ 阅读量、点赞、在看、分享、收藏这几项**本接口取不到**，一律返回 `null` 并列在
  `$.data.unavailable[]`，**不会用 `0` 冒充** —— 调用方可据此区分「这篇文章真的是 0」
  和「这条路取不到」。需要这些指标请用 `/fetch_article_stats`。
- 价格：0.01$/次
- ⏱️ 请将客户端超时（timeout）设置为 30 秒。
- ⚠️ 大整数 ID 精度：`comment_id` / `appmsgid` 为 64 位大整数，请以**字符串**方式接收 / 传递。
- 💡 **提速**：传 `comment_id` 可让上游跳过整篇文章的抓取解析，实测本接口从 15.10s 降到 6.91s / 评论接口从 8.28s 降到 6.13s。该值取自 `/fetch_article_detail` 或 `/fetch_article_detail_h5` 响应的 `$.data.content.comment_id`，拿它是零成本的。
### 参数:
- url: 公众号文章链接（`https://mp.weixin.qq.com/s/…`）。
- raw: 可选，默认 True。True=附带评论接口的原始计数字段；False=仅计数。
  **两者顶层结构一致**，raw 只增减字段。
### 返回:
- 评论数 / 精选评论数；其余互动指标为 `null` 并列在 `unavailable[]`

### 响应结构与 JSON Path:
#### `raw=false`（计数）:
- `$.data.comment_count`: 评论总数
- `$.data.elected_comment_count`: 精选评论数
- `$.data.read_num` / `$.data.like_count` / `$.data.old_like_count` /
  `$.data.share_count` / `$.data.collect_count` / `$.data.star_num`: 本接口恒为 `null`
- `$.data.unavailable[]`: 本接口取不到的字段名清单（与上一行对应）
#### `raw=true`（附带原始计数字段）:
- `data` 顶层同 `raw=false`，另加:
    - `$.data.comment_raw.total_count` / `$.data.comment_raw.elected_total`: 评论接口给的原始计数
    - `$.data.comment_raw.comment_id` / `$.data.comment_raw.appmsgid`: 文章的评论 id / 图文 id

# [English]
### Purpose:
- Fetch comment counts for a WeChat MP article via the H5 channel.
- Read count / likes / shares / favorites are **not available** here: they are returned as
  `null` and listed in `$.data.unavailable[]` (never faked as `0`). Use
  `/fetch_article_stats` when you need them.
- Price: 0.01$/request
### Parameters:
- url: WeChat MP article URL.
- raw: Optional, default True. True = include raw counter fields; False = counts only.
### Returns:
- comment_count / elected_comment_count; other metrics are null and listed in unavailable[]

## Request body

- FetchArticleStatsH5Request: `/fetch_article_stats_h5` 请求体。 单独一个模型而不是复用 FetchArticleDetailRequest：comment_id 只对本接口有意义， 挂在共用模型上会让文章详情等接口的文档里也冒出一个用不上的参数。
  - `url` string, required: 公众号文章链接（https://mp.weixin.qq.com/s/… 或带 __biz 的长链）/WeChat MP article URL (https://mp.weixin.qq.com/s/… or long URL with __biz)
  - `raw` boolean: True=原始响应；False=精简解析结构/True=raw response; False=simplified parsed structure
  - `comment_id` string, nullable: 文章的评论 id（可选，**性能捷径**）：不传时上游要先抓并解析整篇文章 HTML 才能拿到它，约占本接口耗时的一半；已有该值时传进来可显著加快。取自 /fetch_article_detail 或 /fetch_article_detail_h5 响应的 `$.data.content.comment_id`/Article comment id (optional, performance shortcut): when omitted, upstream must fetch and parse the whole article HTML to obtain it, which accounts for about half of this endpoint's latency

## Response `200`

Successful Response

- ResponseModel
  - `code` integer: HTTP status code | HTTP状态码
  - `request_id` string, nullable: Unique request identifier | 唯一请求标识符
  - `message` string: Response message (EN-US) | 响应消息 (English)
  - `message_zh` string: Response message (ZH-CN) | 响应消息 (中文)
  - `support` string: Support message | 支持消息
  - `time` string: The time the response was generated | 生成响应的时间
  - `time_stamp` integer: The timestamp the response was generated | 生成响应的时间戳
  - `time_zone` string: The timezone of the response time | 响应时间的时区
  - `docs` string, nullable: Link to the API Swagger documentation for this endpoint | 此端点的 API Swagger 文档链接
  - `cache_message` string, nullable: Cache message (EN-US) | 缓存消息 (English)
  - `cache_message_zh` string, nullable: Cache message (ZH-CN) | 缓存消息 (中文)
  - `cache_url` string, nullable: The URL to access the cached result | 访问缓存结果的 URL
  - `router` string: The endpoint that generated this response | 生成此响应的端点
  - `params` unknown
  - `data` unknown

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-08** `96a122a5f220`: 2 info
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - added the optional property `detail/items/input` to the response with the `422` status
- **2026-09-08** `485e774cb449`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/tikhub/apis/tikhub-douyin-tiktok-xiaohongshu-lemon8-bilibili-kuaishou-pi/changes/api/v1/wechat_mp/v2/fetch_article_stats_h5/post.md)

---

[API](https://skmtc.dev/tikhub/apis/tikhub-douyin-tiktok-xiaohongshu-lemon8-bilibili-kuaishou-pi.md) - [All operations](https://skmtc.dev/tikhub/apis/tikhub-douyin-tiktok-xiaohongshu-lemon8-bilibili-kuaishou-pi/llms.txt) - [OpenAPI document](https://skmtc.dev/tikhub/apis/tikhub-douyin-tiktok-xiaohongshu-lemon8-bilibili-kuaishou-pi/revisions/86a3483c705a?raw)
