# 知乎 问题下的回答 API (zhihu.question_answers)

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

知乎问题下的回答按问题 `url` 读取一个问题下面的回答，每条带回答全文 `text`、标题 `title`、赞同数、评论数、收藏数 `collect_count`、感谢数 `thanks_count`，以及答主的昵称、简介、认证说明和粉丝数 `author_follower_count`。它回答「这个问题下大家怎么答、哪几条回答最受认可」，适合做观点对比，或者筛出专业答主。

`url` 可以是 https://www.zhihu.com/question/<问题ID> 形式的问题链接，也可以是这个问题下某条回答的链接，或者纯数字的问题 ID。`sort` 取 `default`（知乎默认排序）或 `updated`（按时间从新到旧）。默认和上限都是 20 条。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 知乎问题链接（https://www.zhihu.com/question/<问题ID>），也可以是这个问题下的回答链接或纯数字问题 ID。 |
| sort | enum: default / updated | no | not declared | 回答排序：default 知乎默认排序（默认）/ updated 按时间从新到旧。 |
| limit | integer (1–20) | no | 20 | 这次调用最多返回的条数，整数，1–20；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| type | 内容类型（answer 回答 / article 文章 / video 视频；hot_list 上是 question 问题；user_pins 是 pin 想法；column_search 是 column 专栏；salt_search 是盐选商品类型，如 paid_column_chapter 付费专栏的一篇；scholar_search 是 paper 论文）。 |
| url | 该记录在原平台上的可访问链接。 |
| question_id | 回答所在问题的 ID（question_answers），和请求的问题一致。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| collect_count | 收藏数。 |
| thanks_count | 这条回答收到的感谢数（question_answers）。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| updated_at | 回答最后编辑时间（question_answers、user_answers），ISO 8601、UTC；没改过时和 posted_at 相同。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_name | 作者昵称（显示名）。 |
| author_url | 作者主页链接。 |
| author_avatar_url | 作者头像链接；评论类结果里是评论者的头像。 |
| author_bio | 作者简介。 |
| author_follower_count | 作者粉丝数。 |
| author_verification_label | 认证说明。 |
| 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": "question_answers",
  "params": {
    "url": "https://www.zhihu.com/question/265808959"
  }
}'
```

```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": "question_answers",
        "params": {
            "url": "https://www.zhihu.com/question/265808959",
        },
    },
    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": "question_answers",
  "results": [
    {
      "id": …,
      "type": …,
      "url": …,
      "question_id": …,
      "title": …,
      "text": …,
      "like_count": …,
      "comment_count": …,
      "collect_count": …,
      "thanks_count": …,
      "posted_at": …,
      "updated_at": …,
      "author_id": …,
      "author_name": …,
      "author_url": …,
      "author_avatar_url": …,
      "author_bio": …,
      "author_follower_count": …,
      "author_verification_label": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 问题下的回答和用户回答该怎么选？

手里有问题链接、想看各路答主怎么答，用这一页；已经锁定某位答主、想读他写过的全部回答，用用户回答那一页。这里按问题取，多出收藏数、感谢数和答主粉丝数；用户回答那一页有翻页参数，这一页没有，单次最多 20 条。

### `sort` 选 `default` 还是 `updated`？

想看知乎自己怎么排，就用 `default`，也是不传时的取值；想追踪一个问题下有没有新回答，用 `updated`，再对照 `posted_at` 和 `updated_at` 看每条回答是新发的还是新改的。

### 一个问题下的回答能读全吗？

回答超过 20 条的问题读不全。单次最多返回 20 条，这一页没有翻页参数，只能拿到所选排序下的前 20 条。想多看几个角度，可以换 `sort` 各读一次，再按回答 `id` 去重合并；`question_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
