WeChat Get Article Stats H5
## Purpose Get the total and elected comment counts for a WeChat Official Account article. This tool returns comment statistics only, not article text or individual comments. ## Inputs Pass an object named `request_body` containing: - `url` (required): A WeChat article URL on `mp.weixin.qq.com` using the `/s` path, such as `https://mp.weixin.qq.com/s/…`, or a supported long link with `__biz`. Maximum length: 2048 characters. - `raw` (optional, default `true`): Include raw comment counter fields when true; return counts without those extra fields when false. The top-level response structure is the same in both modes. - `comment_id` (optional): The article's comment ID as a numeric string of up to 32 characters, or `null`. If already available from article details at `$.data.content.comment_id`, supplying it can reduce parsing work. The URL is still required. ## Results and limitations - `$.data.comment_count`: Total comment count. - `$.data.elected_comment_count`: Elected comment count. - `$.data.read_num`, `$.data.like_count`, `$.data.old_like_count`, `$.data.share_count`, `$.data.collect_count` and `$.data.star_num`: Always `null` for this tool. Their names appear in `$.data.unavailable[]`. Unavailable does not mean zero. - With `raw=true`, `$.data.comment_raw` additionally contains `total_count`, `elected_total`, `comment_id` and `appmsgid`. Keep `comment_id` and `appmsgid` as strings to avoid loss of precision for large IDs. Set the client timeout to 30 seconds. If you need read counts or other unavailable engagement metrics, use a separate article-statistics capability; this tool does not automatically switch to one.
Pricing
| Condition | Charge |
|---|---|
| Each call | 20.65 credits/call |
20.65 credits/call Charges are per query. A successful query is billed even if it returns no results.
Parameters
Optional parameters use the platform defaults when omitted.
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
request_body | object | Yes | 用于查询微信公众号文章评论总数与精选评论数的请求体对象。url 为必填的文章链接;raw 为可选开关,默认 true,控制是否附带原始评论计数字段;comment_id 为可选的文章评论 ID,已知时传入可减少文章抓取解析工作。 | — |
request_body.raw | boolean | No | True=原始响应;False=精简解析结构/True=raw response; False=simplified parsed structure | true |
request_body.url | string | Yes | 公众号文章链接(https://mp.weixin.qq.com/s/… 或带 __biz 的长链)/WeChat MP article URL (https://mp.weixin.qq.com/s/… or long URL with __biz) | — |
request_body.comment_id | string | null | No | 文章的评论 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 | — |
Invocation example
Parameter templateGenerated from the parameter configuration. Replace the sample values before use.
/agent-api/v1/tool/executeX-Api-Keycurl --request POST \
--url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_wechat_get_article_stats_h5' \
--header "X-Api-Key: $AGENTEARTH_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {
"request_body": {
"url": "https://mp.weixin.qq.com/s/TSNQKkRpN1qbKsT7BvzqIw"
}
}
}'No response example available yet.


