WeChat-Media-Platform-V2-API

获取公众号评论的二级回复/Get WeChat MP Comment Replies

Changed on

[中文]

用途:

  • 返回某条一级评论下的二级回复。
  • 链路:先调 fetch_article_comments 取到每条评论的 content_id,再把它喂给本接口。
  • 价格:0.01$/次
  • ⏱️ 由于微信服务器原因,本接口响应较慢,请将客户端请求超时(timeout)设置为 30 秒;timeout 设置过小会造成已扣费但收不到响应的情况。
  • ⚠️ 大整数 ID 精度:响应中的 content_id / reply_id 等为 64 位大整数,超出 JavaScript 安全整数范围(2^53-1)。请始终以字符串方式接收 / 传递这类 ID(解析 JSON 用 json-bigint 或按文本取值),勿让其经过 JS Number。Swagger UI 文档页对超大整数会末位舍入显示,属正常现象,不影响接口实际返回的数据。
  • 💡 提速:传 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/…)。示例 http://mp.weixin.qq.com/s?__biz=Mzk3NTA0MzM5NA==&mid=2247483745&idx=1&sn=3f34e768cf457a501038991ed30be1f4#rd
  • content_id: 可选(纯数字)。目标一级评论的 content_id,取自 fetch_article_comments 响应的 $.data.comments[N].content_id;不传则自动取第一条有回复的评论。示例 12109128638545265979
  • offset: 可选,默认 0(>=0)。回复翻页偏移;首页 0,has_more=true 时传上次返回的 next_offset 取下一页。
  • ⚠️ 上游已移除 all_pages 自动翻页:它一次计费最多打 30 个上游请求,且自动翻页模式不返回 has_more / next_offset,调用方无从发现结果被截断(实测 400 条回复只给回前 300)。翻页统一用 offset / next_offset 驱动,与 /fetch_article_comments 的游标契约一致。
  • raw: 可选,默认 True。True=完整原始回复对象;False=精简回复。

返回:

  • 二级回复列表及翻页信息

注意:本接口 raw=true 与 raw=false 的外层结构一致,差异仅在 replies[] 每个元素的字段粒度(精简视图 vs 完整原始对象)。

响应结构与 JSON Path:

raw=false(精简回复):

  • $.data.content_id: 目标评论 id(回显)
  • $.data.parent_nick: 父评论(被回复者)昵称
  • $.data.reply_total: 二级回复总数
  • $.data.count: 本次返回的回复条数
  • $.data.replies[N].reply_id: 回复 id
  • $.data.replies[N].nick_name: 回复者昵称
  • $.data.replies[N].content: 回复内容
  • $.data.replies[N].create_time: 回复时间戳
  • $.data.replies[N].ip_wording: IP 归属地
  • $.data.replies[N].identity_name: 身份标识
  • $.data.replies[N].from_ai / reply_is_elected: 是否 AI 回复 / 是否精选
  • 翻页字段: $.data.offset / $.data.next_offset / $.data.has_more

raw=true(原始):

  • 外层 content_id / parent_nick / reply_total / count(及单页模式的 offset / next_offset / has_more)与 raw=false 完全一致;差异仅在 replies[] 元素为完整原始回复对象(含 raw=false 投影掉的字段)。常用路径仍为 $.data.replies[N].content / $.data.replies[N].reply_id / $.data.replies[N].nick_name。

[English]

Purpose:

  • Get the second-level replies under a first-level comment.
  • Chain: first call fetch_article_comments to get each comment's content_id, then feed it into this endpoint.
  • 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_id / reply_id in 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 JS Number. 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. http://mp.weixin.qq.com/s?__biz=Mzk3NTA0MzM5NA==&mid=2247483745&idx=1&sn=3f34e768cf457a501038991ed30be1f4#rd
  • content_id: Optional (numeric). content_id of the target first-level comment, from $.data.comments[N].content_id of the fetch_article_comments response; defaults to the first comment that has replies when omitted. E.g. 12109128638545265979
  • offset: Optional, default 0 (>=0). Reply pagination offset; 0 for the first page, pass next_offset from the previous response when has_more=true.
  • Note: all_pages was removed upstream — it issued up to 30 upstream requests per billed call and omitted has_more / next_offset, so callers could not tell the result was truncated. Paginate with offset / next_offset instead.
  • raw: Optional, default True. True=full raw reply objects; False=simplified replies.

Return:

  • Second-level reply list with pagination info

Note: the outer structure is identical for raw=true and raw=false; the difference is only in the field granularity of each replies[] element (simplified view vs full raw object).

Response structure & JSON Path:

raw=false (simplified replies):

  • $.data.content_id: target comment id (echo)
  • $.data.parent_nick: nickname of the parent comment (the one replied to)
  • $.data.reply_total: total second-level replies
  • $.data.count: number of replies returned this time
  • $.data.replies[N].reply_id: reply id
  • $.data.replies[N].nick_name: replier nickname
  • $.data.replies[N].content: reply content
  • $.data.replies[N].create_time: reply timestamp
  • $.data.replies[N].ip_wording: IP region
  • $.data.replies[N].identity_name: identity label
  • $.data.replies[N].from_ai / reply_is_elected: AI reply / featured flags
  • Pagination fields: $.data.offset / $.data.next_offset / $.data.has_more

raw=true (raw):

  • Outer content_id / parent_nick / reply_total / count (and offset / next_offset / has_more in single-page mode) are identical to raw=false; the only difference is that replies[] elements are full raw reply objects (including fields projected away in raw=false). Common paths remain $.data.replies[N].content / $.data.replies[N].reply_id / $.data.replies[N].nick_name.
post/api/v1/wechat_mp/v2/fetch_comment_replies

Request

  • Base URL
    https://api.tikhub.io (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Request body

urlstring required
content_idstring nullable

目标一级评论的 content_id(纯数字),不传则自动取第一条有回复的评论/content_id (numeric) of the target first-level comment; defaults to the first comment that has replies

offsetinteger

回复翻页偏移,首页 0;has_more=true 时传上次返回的 next_offset/Reply pagination offset, 0 for first page; pass next_offset from the previous response when has_more=true

comment_idstring 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

rawboolean

True=原始响应;False=精简解析结构/True=raw response; False=simplified parsed structure

Example request

{
  "url": "http://mp.weixin.qq.com/s?__biz=Mzk3NTA0MzM5NA==&mid=2247483745&idx=1&sn=3f34e768cf457a501038991ed30be1f4#rd",
  "content_id": "12109128638545265979"
}

Response

Successful Response

codeinteger

HTTP status code | HTTP状态码

request_idstring nullable

Unique request identifier | 唯一请求标识符

messagestring

Response message (EN-US) | 响应消息 (English)

message_zhstring

Response message (ZH-CN) | 响应消息 (中文)

supportstring

Support message | 支持消息

timestring

The time the response was generated | 生成响应的时间

time_stampinteger

The timestamp the response was generated | 生成响应的时间戳

time_zonestring

The timezone of the response time | 响应时间的时区

docsstring nullable

Link to the API Swagger documentation for this endpoint | 此端点的 API Swagger 文档链接

cache_messagestring nullable

Cache message (EN-US) | 缓存消息 (English)

cache_message_zhstring nullable

Cache message (ZH-CN) | 缓存消息 (中文)

cache_urlstring nullable

The URL to access the cached result | 访问缓存结果的 URL

routerstring

The endpoint that generated this response | 生成此响应的端点

paramsunknown
dataunknown

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • warning

      removed the request property

    • info

      added the new optional request property