# 知乎 话题搜索 API (zhihu.topic_search)

- Canonical page: [https://everyinfra.com/zhihu-api/topic_search](https://everyinfra.com/zhihu-api/topic_search?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "zhihu", "action": "topic_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 20 per call
- 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=topic_search

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | 知乎话题搜索词，1 到 100 个字，例如 Python；超过 100 个字返回 422，不扣费。 |
| limit | integer (1–20) | no | 20 | 这次调用最多返回的条数，整数，1–20；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接，可能有时效。 |
| follower_count | 关注人数：hot_list、question_detail 是关注这个问题的人数；user_search 是账号粉丝数；column_search 是关注这个专栏的人数；topic_search 是关注这个话题的人数。 |
| question_count | 话题下的问题数（topic_search）。 |
| visit_count | 浏览量：topic_search 是话题的浏览量，question_detail 是问题的浏览量。 |
| 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": "topic_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": "topic_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": "topic_search",
  "results": [
    {
      "id": …,
      "url": …,
      "name": …,
      "avatar_url": …,
      "follower_count": …,
      "question_count": …,
      "visit_count": …,
      "platform": …
    }
  ],
  "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
