# 知乎 关键词搜索 API (zhihu.search)

- Canonical page: https://everyinfra.com/zhihu-api/search
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "zhihu", "action": "search", "params": {...}}
- Price: $0.000792 per call ($0.79 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

知乎关键词搜索按 `keyword` 检索知乎上的回答、文章和视频，返回内容类型、标题、正文、赞同、评论和收藏数、发布时间，以及作者昵称、简介、粉丝数和认证说明。它回答「这个问题在知乎上大家怎么说、谁说得有分量」，适合做用户研究、产品口碑调研、选题和寻找领域专家。

用 `content_type` 只看回答、文章或视频，用 `sort` 按综合、赞同最多或最新发布排序。`type` 标明每条结果是回答、文章还是视频，三者的链接格式不同；`author_verification_label` 说明作者的认证身份，可以用来筛选专业回答。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | search 的知乎内容检索词；不是内容 URL、作者短名或主页链接。 |
| content_type | enum: all / answer / article / video | no | not declared | search 的内容类型过滤：all 全部（默认）/ answer 回答 / article 文章 / video 视频。 |
| sort | enum: general / time_descending / upvote_count_descending | no | not declared | search 的排序：general 综合（默认）/ upvote_count_descending 最多赞同 / time_descending 最新发布。 |
| limit | integer (1–100) | no | 20 | 这次调用最多返回的条数，整数，1–100；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 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 | 该记录在原平台上的可访问链接。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| collect_count | 收藏数。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| cover_image_url | 封面图。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_name | 作者昵称（显示名）。 |
| author_url | 作者主页链接。 |
| author_avatar_url | 作者头像链接；评论类结果里是评论者的头像。 |
| author_bio | 作者简介。 |
| author_follower_count | 作者粉丝数。 |
| author_verified | 作者是否认证。 |
| author_verification_label | 认证说明。 |

## 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": "search",
  "params": {
    "keyword": "如何学习摄影"
  }
}'
```

```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": "search",
        "params": {
            "keyword": "如何学习摄影",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

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

```text
{
  "id": "req_…",
  "platform": "zhihu",
  "action": "search",
  "results": [
    {
      "id": "•••",
      "type": "answer",
      "url": "https://www.zhihu.com/question/1920106849895679845/answer/2031448129422218730",
      "title": "新手小白如何系统的学习摄影？",
      "text": "也最有效。至于课程，先学《摄影基础》，再补《大学摄影基础》或《新闻摄影》，边学边拍，别把自己学成一个只会收藏课程的摄影旁观者",
      "like_count": 208,
      "comment_count": 12,
      "collect_count": 599,
      "posted_at": "2026-04-25T11:02:56+00:00",
      "cover_image_url": "https://picx.zhimg.com/80/v2-c4ec584ba597667997b8c2cde7c6616d_qhd.jpg?source=4e949a73",
      "platform": "zhihu",
      "author_id": "•••",
      "author_name": "•••",
      "author_url": "https://www.zhihu.com/•••",
      "author_avatar_url": "https://picx.zhimg.com/•••",
      "author_bio": "•••",
      "author_follower_count": 1703,
      "author_verified": true,
      "author_verification_label": "视觉中国500px总经理、国家地理摄影大赛评委"
    },
    {
      "id": "•••",
      "type": "answer",
      "url": "https://www.zhihu.com/question/36095338/answer/1982462290939880115",
      "title": "新手如何系统性地学习摄影？",
      "text": "除非你干婚庆，爱好者不需要“系统性”学习摄影。 第二，提升摄影水平的最好的方式就是去拍那些你能在社交媒体（微信朋友圈/微博/小红书）获得夸奖的图",
      "like_count": 49,
      "comment_count": 16,
      "collect_count": 35,
      "posted_at": "2025-12-11T06:50:42+00:00",
      "platform": "zhihu",
      "author_id": "•••",
      "author_name": "•••",
      "author_url": "https://www.zhihu.com/•••",
      "author_avatar_url": "https://picx.zhimg.com/•••",
      "author_bio": "•••",
      "author_follower_count": 259,
      "author_verified": false,
      "author_verification_label": ""
    }
  ],
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 怎么只看高赞回答？

把 `content_type` 设为 `answer` 只看回答，再把 `sort` 设为 `upvote_count_descending`，按赞同数从高到低排序；结果里的 `like_count` 就是赞同数。

### `keyword` 能直接填问题链接吗？

不能。`keyword` 是检索词，不是内容链接、作者短名或主页链接。已经有回答、文章或视频的链接时，用知乎的内容详情能力读取；问题页链接它不支持。

### 怎么找到某个领域里说话有分量的人？

看 `author_verified` 和 `author_verification_label` 的认证说明，再结合 `author_follower_count` 和回答的赞同数；认证身份与话题相关、赞同数又高的作者更值得关注。

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