WeChat-Media-Platform-V2-API
获取公众号文章互动数据(H5 版本)/Get WeChat MP Article Stats (H5)
Changed on[中文]
用途:
-
传文章 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[]
post/api/v1/wechat_mp/v2/fetch_article_stats_h5
Request
- Base URLhttps://api.tikhub.io (the document declares no server; this is the origin it was published from)
- AuthHTTP bearer
Request body
Example request
{
"url": "https://mp.weixin.qq.com/s/TSNQKkRpN1qbKsT7BvzqIw"
}Response
Successful Response
Changes
- info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status
- info
- info
endpoint added
- info