# 知乎 账号搜索 API (zhihu.user_search)

- Canonical page: https://everyinfra.com/zhihu-api/user_search
- Endpoint: POST /api/v1/social with {"platform": "zhihu", "action": "user_search", "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

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 按昵称或关键词找知乎用户，例如 张佳玮；返回的 username 可接着查 profile、user_answers、user_pins。 |
| page_token | not declared | no | not declared | 翻页令牌。第一页不传；之后把上一页响应里的 next_page_token 原样传回取下一页。每页 20 个账号，每页算一次调用。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| user_id | 用户在原平台的唯一 ID。 |
| username | 知乎个性域名（user_search），就是主页链接 zhihu.com/people/<username> 里那一段；可直接作为 profile、user_answers、user_pins 的 url 传入。 |
| display_name | 显示名，可能与 username 不同。 |
| url | 该记录在原平台上的可访问链接。 |
| bio | 个人简介，账号自己填写的文本。可能含换行和 emoji。 |
| avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接，可能有时效。 |
| gender | 性别（user_search）：male / female；账号没公开时没有这个字段。 |
| follower_count | 关注人数：hot_list 是关注这个问题的人数；user_search 是账号粉丝数；column_search 是关注这个专栏的人数。 |
| answer_count | 回答数：profile、user_search 是这个账号写过的回答总数；hot_list 是这个问题下的回答数。 |
| article_count | 文章数：profile、user_search 是这个账号的文章总数；column_search 是这个专栏收录的文章数。 |
| received_upvote_count | 累计获赞（profile、user_search）。 |
| verification_label | 知乎给的认证或荣誉说明（user_search），如「优秀回答者」「已认证的机构」；没有时没有这个字段。 |
| 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_search",
  "params": {
    "keyword": "python"
  }
}'
```

```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_search",
        "params": {
            "keyword": "python",
        },
    },
    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_search",
  "results": [
    {
      "user_id": …,
      "username": …,
      "display_name": …,
      "url": …,
      "bio": …,
      "avatar_url": …,
      "gender": …,
      "follower_count": …,
      "answer_count": …,
      "article_count": …,
      "received_upvote_count": …,
      "verification_label": …,
      "platform": …
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

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