# 知乎 评论回复 API (zhihu.comment_replies)

- Canonical page: https://everyinfra.com/zhihu-api/comment_replies
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "zhihu", "action": "comment_replies", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 20, max 100 per call
- Mode: sync; add "mode": "async" for slow tasks

知乎评论回复读取某条评论下面的回复，需要两样东西：这条评论所在内容的 `url`，和评论本身的 `comment_id`。每条回复带正文、点赞数、发布时间、回复者昵称、ID 和头像。它回答「这条评论引出了哪些讨论」，适合深挖高赞评论下的争论、收集读者在追问里暴露的具体问题，或者完整还原一段对话。`text` 是去掉 HTML 标签后的全文，不截断；`like_count` 为 null 表示接口不公开点赞数，不等于 0。

`comment_id` 从内容评论的结果里取，选 `reply_count` 大于 0 的那条；回复数为 0 的评论没有可读的回复。`posted_at` 是 UTC 的 ISO 8601 时间，平台只给非标准字符串时原样透传，解析前最好做容错。

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=zhihu&action=comment_replies

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 内容或主页链接。content_detail/content_comments 接受回答、文章、视频链接（不支持问题页）；profile/user_articles 接受 zhihu.com/people/ 主页链接；question_answers 接受问题链接。 |
| comment_id | not declared | yes | not declared | comment_replies 的评论 ID，从 content_comments 结果里 reply_count 大于 0 的行取。 |
| limit | integer (1–100) | no | 20 | 这次调用最多返回的条数，整数，1–100；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| reply_count | 回复数，通常用于评论的子回复。null 表示不公开。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_name | 作者昵称（显示名）。 |
| author_avatar_url | 作者头像链接；评论类结果里是评论者的头像。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "zhihu",
  "action": "comment_replies",
  "params": {
    "url": "https://zhuanlan.zhihu.com/p/2032860336215307118",
    "comment_id": "11472966499"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "zhihu",
        "action": "comment_replies",
        "params": {
            "url": "https://zhuanlan.zhihu.com/p/2032860336215307118",
            "comment_id": "11472966499",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-10-24T22:02:00Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 8. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "zhihu",
  "action": "comment_replies",
  "results": [
    {
      "id": "•••",
      "text": "一个这种古人式模型如何认识西方和理解西方和现代化的？感觉会很有意思",
      "like_count": 6,
      "author_id": "•••",
      "author_name": "•••",
      "author_avatar_url": "https://pic1.zhimg.com/•••",
      "platform": "zhihu"
    },
    {
      "id": "•••",
      "text": "非常好的想法，可以用来回答很多知乎问题。[捂嘴]",
      "like_count": 3,
      "author_id": "•••",
      "author_name": "•••",
      "author_avatar_url": "https://picx.zhimg.com/•••",
      "platform": "zhihu"
    }
  ],
  "count": 8,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `comment_id` 从哪里来？

先用知乎内容评论读这篇回答、文章或视频的一级评论，每行的 `id` 就是评论 ID。挑 `reply_count` 大于 0 的那条，连同原来的内容链接一起传进来，就能读到它下面的回复。`reply_count` 为 null 表示平台不公开回复数，不能当成 0 把这条评论跳过。示例里的评论 ID 就是这样取来的，它来自示例文章的内容评论结果。这一页每行的 `id` 是回复自己的 ID，和传进来的 `comment_id` 不是同一个。

### 为什么还要传内容链接？

评论 ID 要和它所在的回答、文章或视频对上，才能定位到那一楼。`url` 填读内容评论时用的那个链接，两者保持一致即可。它和内容评论那一页的 `url` 是同一个参数：回答、文章、视频的链接都可以，问题页不行。示例里用的是一篇知乎专栏文章的链接。`author_name` 和 `author_avatar_url` 是回复者的昵称和头像，不是被回复评论作者的。

### 怎么把一整片讨论读全？

先用内容评论拿到一级评论，按 `reply_count` 从大到小挑出讨论最多的几条，再逐条用评论回复读下面的回复。回复较多时用 `limit` 调大这次返回的条数。每次默认返回 20 条、最多 100 条：回复数不超过 20 的评论，默认值就能读完；超过 100 的，单次只能读到 100 条。还原一段对话时，按 `posted_at` 排序，用 `author_id` 区分是谁在回复。

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=zhihu
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
