# 知乎 想法评论 API (zhihu.pin_comments)

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

知乎想法评论读取一条想法下面的评论，传想法的 `url` 就行。每条评论有全文 `text`、点赞数 `like_count`、发布时间 `posted_at` 和子回复数 `reply_count`，评论者给出昵称、ID 和头像。它回答「大家怎么回应这条随手发的短内容」，适合读完某位用户的想法之后，挑出评论多的几条，继续看读者的反应。

`url` 填 https://www.zhihu.com/pin/<想法ID>，也可以只填数字想法 ID，这个 ID 就是用户想法那一页返回行里的 `id`，不用自己拼链接。一次默认给 20 条评论，`limit` 可以调到 100；子回复数读不到时是 null，不代表没人回复。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 知乎想法链接（https://www.zhihu.com/pin/<想法ID>），也可以只填数字想法 ID（user_pins 返回行的 id）。 |
| 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": "pin_comments",
  "params": {
    "url": "https://www.zhihu.com/pin/2065248867814209080"
  }
}'
```

```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": "pin_comments",
        "params": {
            "url": "https://www.zhihu.com/pin/2065248867814209080",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "zhihu",
  "action": "pin_comments",
  "results": [
    {
      "id": …,
      "text": …,
      "like_count": …,
      "posted_at": …,
      "reply_count": …,
      "author_id": …,
      "author_name": …,
      "author_avatar_url": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 想法评论和内容评论读的是同一类东西吗？

不是。内容评论读回答、文章和视频下的评论，这一页读知乎想法下的评论。两边返回的字段相同，区别在传的链接：想法链接或数字想法 ID 用这一页，回答、文章、视频的链接用内容评论。评论热度和时间分布，仍然用 `like_count` 和 `posted_at` 来算。

### 想法 ID 从哪里拿？

先用用户想法按主页链接读一位用户的想法，结果每行的 `id` 就是想法 ID，可以直接填进 `url`。想挑评论多的想法，在用户想法的结果里按评论数排序再来读，比逐条试更快。示例里的想法 ID 是 2065248867814209080。

### 想法评论下面的回复在哪里读？

这一页只给回复数 `reply_count`，不返回回复正文。评论回复那一页写明的评论 ID 来源是内容评论的结果，没有列出想法评论，传想法评论的 ID 前先确认那一页的参数说明。评论者的 `author_id` 和 `author_name` 可以先存下来，和别处的数据对账。

## 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
