获取公众号文章评论/Get WeChat MP Article Comments
WeChat MPapi
About
获取公众号文章评论/Get WeChat MP Article Comments
Documentation
获取公众号文章评论/Get WeChat MP Article Comments
[中文]
用途:
- 获取公众号文章评论(单页,
buffer游标翻页),返回文章的一页精选评论。 - 翻页:首页
buffer留空 → 取响应的buffer→ 下次请求传回buffer取下一页;has_more为 false 即到末页。 - 逐条评论的二级回复请用
fetch_comment_replies(传评论的content_id)。 - 价格:0.01$/次
- ⏱️ 由于微信服务器原因,本接口响应较慢,请将客户端请求超时(timeout)设置为 30 秒;timeout 设置过小会造成已扣费但收不到响应的情况。
- ⚠️ 大整数 ID 精度:响应中的
content_id等为 64 位大整数,超出 JavaScript 安全整数范围(2^53-1)。请始终以字符串方式接收 / 传递这类 ID(解析 JSON 用 json-bigint 或按文本取值),勿让其经过 JSNumber。Swagger UI 文档页对超大整数会末位舍入显示,属正常现象,不影响接口实际返回的数据。
参数:
- url: 公众号文章链接(
https://mp.weixin.qq.com/s/…)。示例https://mp.weixin.qq.com/s/TSNQKkRpN1qbKsT7BvzqIw - buffer: 可选,默认空。翻页游标,首页留空;翻页传上一页响应的
buffer。 - raw: 可选,默认 True。True=完整原始评论对象;False=精简评论视图。
返回:
- 单页评论列表及翻页游标
响应结构与 JSON Path:
raw=false(精简视图):
data外层为本页汇总,comments[]为精简评论:$.data.appmsgid: 图文消息 id$.data.elected_total: 精选评论总数$.data.total_count: 评论总数$.data.buffer: 下一页游标(翻页回传buffer;末页为空串)$.data.has_more: 是否还有下一页$.data.comment_id: 文章评论标识(内部用)$.data.comments[N].content_id: 评论 id(喂fetch_comment_replies的content_id)$.data.comments[N].nick_name: 评论者昵称$.data.comments[N].content: 评论内容$.data.comments[N].like_num: 点赞数$.data.comments[N].create_time: 评论时间戳$.data.comments[N].ip_wording: IP 归属地(province_name/city_name等)$.data.comments[N].is_elected/is_top: 是否精选 / 置顶$.data.comments[N].reply_total: 二级回复总数$.data.comments[N].replies[]: 二级回复预览(精简,见fetch_comment_replies)
raw=true(原始):
data外层同上(appmsgid/elected_total/total_count/buffer/has_more/comment_id),comments[]为完整原始评论对象,字段更全(snake_case):$.data.comments[N].content_id: 评论 id(同精简模式,仍是喂fetch_comment_replies的值)$.data.comments[N].content/nick_name/like_num/create_time/ip_wording/is_elected/is_top: 与raw=false同名同义- 原始模式额外字段:
$.data.comments[N].id(楼层序号)/openid/identity_type/logo_url(头像)/like_status/is_from_me/$.data.comments[N].reply_new(含reply_total_cnt/reply_list,对应精简模式的reply_total/replies)
[English]
Purpose:
- Get WeChat MP article comments (single page,
buffercursor pagination); returns one page of featured comments. - Pagination: leave
bufferempty for the first page → takebufferfrom the response → pass it back in the next request;has_morefalse means the last page. - For second-level replies of a specific comment, use
fetch_comment_replies(pass the comment'scontent_id). - Price: $0.01 per request
- ⏱️ Due to WeChat server latency, this endpoint responds slowly; please set your client request timeout to 30 seconds — a timeout that is too small may result in being billed without receiving the response.
- ⚠️ Large-integer ID precision: IDs such as
content_idin the response are 64-bit big integers beyond JavaScript's safe-integer range (2^53-1). Always receive / pass such IDs as strings (parse JSON with json-bigint or read them as text), never through JSNumber. Swagger UI rounds the trailing digits of huge integers in its docs view — this is expected and does not affect the actual data returned by the API.
Parameters:
- url: WeChat MP article URL (
https://mp.weixin.qq.com/s/…). E.g.https://mp.weixin.qq.com/s/TSNQKkRpN1qbKsT7BvzqIw - buffer: Optional, default empty. Pagination cursor; leave empty for the first page, pass
bufferfrom the previous response for the next page. - raw: Optional, default True. True=full raw comment objects; False=simplified comment view.
Return:
- One page of comments with pagination cursor
Response structure & JSON Path:
raw=false (simplified view):
dataouter level is the page summary;comments[]are simplified comments:$.data.appmsgid: message id$.data.elected_total: total featured comments$.data.total_count: total comments$.data.buffer: next-page cursor (pass back asbuffer; empty string at the last page)$.data.has_more: whether there is a next page$.data.comment_id: article comment identifier (internal)$.data.comments[N].content_id: comment id (feed intocontent_idoffetch_comment_replies)$.data.comments[N].nick_name: commenter nickname$.data.comments[N].content: comment content$.data.comments[N].like_num: like count$.data.comments[N].create_time: comment timestamp$.data.comments[N].ip_wording: IP region (province_name/city_nameetc.)$.data.comments[N].is_elected/is_top: featured / pinned flags$.data.comments[N].reply_total: total second-level replies$.data.comments[N].replies[]: reply preview (simplified, seefetch_comment_replies)
raw=true (raw):
dataouter level same as above (appmsgid/elected_total/total_count/buffer/has_more/comment_id);comments[]are full raw comment objects with more fields (snake_case):$.data.comments[N].content_id: comment id (same as simplified mode, still the value fed intofetch_comment_replies)$.data.comments[N].content/nick_name/like_num/create_time/ip_wording/is_elected/is_top: same names and meanings asraw=false- Raw-only extra fields:
$.data.comments[N].id(floor number) /openid/identity_type/logo_url(avatar) /like_status/is_from_me/$.data.comments[N].reply_new(withreply_total_cnt/reply_list, corresponding toreply_total/repliesof the simplified mode)
Imported from a validated TikHub OpenAPI document. Pricing must be reviewed before enabling.
Try 获取公众号文章评论/Get WeChat MP Article Comments
Test this model in the Sandbase Playground with your own prompts.
Open in PlaygroundRelated Models
获取公众号文章列表/Get WeChat MP Account ArticlesWeChat MPapi获取公众号资料页/Get WeChat MP Account ProfileWeChat MPapi获取公众号服务/自定义菜单/Get WeChat MP Account Services & Custom MenuWeChat MPapi获取公众号文章广告/Get WeChat MP Article AdsWeChat MPapi获取公众号文章详情/Get WeChat MP Article DetailWeChat MPapi获取公众号文章互动数据/Get WeChat MP Article StatsWeChat MPapi获取公众号评论的二级回复/Get WeChat MP Comment RepliesWeChat MPapi获取公众号关联文章/Get WeChat MP Related ArticlesWeChat MPapi