# 知乎 用户回答 API (zhihu.user_answers)

- Canonical page: https://everyinfra.com/zhihu-api/user_answers
- Endpoint: POST /api/v1/social with {"platform": "zhihu", "action": "user_answers", "params": {...}}
- Price: $0.000806 per call ($0.81 per 1,000 requests); failed and empty results are not charged
- Returns: list, one page of 20 per call (limit is ignored; pass the top-level next_page_token from the response as page_token for the next page)
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; one call per page, tokens last 24 hours
- Mode: sync; add "mode": "async" for slow tasks

知乎用户回答按主页 `url` 分页读取一位答主写过的全部回答，从新到旧，每条带所在问题的 `question_id` 和标题、回答全文、赞同数、评论数，以及首次发布和最后编辑的时间。它回答「这位答主在哪些问题上发言、观点和专业度如何」，常用于筛选垂直领域的合作作者、研究专家的公开论述，或者把一个账号多年的知识沉淀整理成语料。每页固定 20 条，最后一页可能更少，`limit` 照收但不起作用。`author_bio` 和 `author_verification_label` 带着答主的简介和认证说明，评估专业度时可以直接参考。

昵称不能定位账号，需要主页链接或个性域名。想法这类短内容不在这里，由用户想法那一页读取。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 知乎用户主页链接（https://www.zhihu.com/people/<个性域名>），也可以只填个性域名；不收昵称（先用 user_search 找到 username）。 |
| page_token | not declared | no | not declared | 翻页令牌。第一页不传；之后把上一页响应里的 next_page_token 原样传回取下一页，其余参数不变。每页 20 条、最新优先，每页算一次调用。 |

## 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。 |
| 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_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": "user_answers",
  "params": {
    "url": "https://www.zhihu.com/people/zhihuadmin"
  }
}'
```

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

## FAQ

### 只知道昵称怎么办？

先用知乎的用户搜索按昵称或领域词找到这个人，结果里的主页 ID 可以直接填进 `url`；也可以在浏览器打开他的主页，复制 /people/ 后面那段。`url` 填 https://www.zhihu.com/people/<个性域名>，或者只填个性域名都可以，示例里用的是 zhihuadmin 这个账号。知乎重名很常见，确认时对照头像和个人简介。确认之后把 `author_id` 存下来，后续在别的结果里能对上。

### `updated_at` 和 `posted_at` 不一样说明什么？

`posted_at` 是回答第一次发布的时间，`updated_at` 是最后一次编辑的时间。两者相差很大，说明作者后来补充或改写过内容；引用回答里的观点时，要意识到读到的是编辑后的版本，不一定是当初发布时的说法。没改过的回答两个时间相同，所以挑出 `updated_at` 晚于 `posted_at` 的行，就是被编辑过的回答。两者都是 UTC 时区的 ISO 8601 时间。只按发布时间排序会漏掉被重写过的旧回答。

### 怎么按问题把回答归类？

每条回答都带 `question_id` 和问题标题 `title`，按 `question_id` 归组即可。归组之后还能看出这位答主的回答集中在哪些话题上。想看同一问题下其他人怎么答，可以把这个编号交给知乎的问题回答能力，对比这位答主和其他回答者的赞同数差距。`like_count`、`comment_count` 为 null 表示接口不公开，不等于 0；每页算一次调用，回答很多的账号要按页数估算调用量。

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