# 知乎 用户想法 API (zhihu.user_pins)

- Canonical page: https://everyinfra.com/zhihu-api/user_pins
- Endpoint: POST /api/v1/social with {"platform": "zhihu", "action": "user_pins", "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` 分页读取一位用户发过的想法，也就是知乎上类似微博的短内容，从新到旧，每条带去掉排版的正文、配图 `image_urls`，以及赞同、评论、转发和收藏数。它回答「这位用户日常在随手分享什么」：想法比长回答更即时，常能看到对热点的第一反应和个人近况，适合做达人画像、舆情观察，补上只看回答看不到的一面。每页固定 20 条、最新优先，`limit` 照收但不起作用。`author_follower_count` 带着这位用户的粉丝数，筛达人时不用再查主页。

不收昵称，先拿到主页链接或个性域名。纯文字的想法没有 `image_urls`，按图筛选前先判断字段是否存在。示例是 zhihuadmin 的主页。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 知乎用户主页链接（https://www.zhihu.com/people/<个性域名>），也可以只填个性域名；不收昵称。 |
| 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 | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| image_urls | 想法里的图片（user_pins）；纯文字想法没有这个字段。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| repost_count | 被转发次数（user_pins）。 |
| collect_count | 收藏数。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_name | 作者昵称（显示名）。 |
| author_url | 作者主页链接。 |
| author_avatar_url | 作者头像链接；评论类结果里是评论者的头像。 |
| author_follower_count | 作者粉丝数。 |
| 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_pins",
  "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_pins",
        "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_pins",
  "results": [
    {
      "id": …,
      "type": …,
      "url": …,
      "text": …,
      "image_urls": …,
      "like_count": …,
      "comment_count": …,
      "repost_count": …,
      "collect_count": …,
      "posted_at": …,
      "author_id": …,
      "author_name": …,
      "author_url": …,
      "author_avatar_url": …,
      "author_follower_count": …,
      "platform": …
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 想法和回答有什么区别？

回答挂在某个问题下面，通常篇幅较长；想法是独立发布的短内容，可以带图，不属于任何问题，所以结果里没有问题标题。想法的 `type` 是 pin，回答是 answer，两类内容在这个字段上就能分开。要读同一位用户的长回答，用知乎的用户回答能力，传同一个主页链接即可。用户回答那一页多出作者简介和认证说明，这一页没有；换来的是转发数、收藏数和作者粉丝数。想法自己的链接在 `url`，传给用户回答那一页的是作者主页 `author_url`。

### 怎么读某条想法下面的评论？

结果行里的 `id` 就是这条想法的编号，把它交给知乎的想法评论能力，就能读到下面的评论。先用 `comment_count` 排个序，可以快速挑出讨论最多、最值得细读的几条。想法评论那一页既收 https://www.zhihu.com/pin/<想法ID> 这样的链接，也收纯数字想法 ID，所以直接填这里的 `id` 即可，不用自己拼链接。`posted_at` 是 UTC 时区的 ISO 8601 时间，可以先按它截出某段时间内的想法，再去读评论。

### `collect_count` 和 `repost_count` 分别说明什么？

`collect_count` 是这条想法被收藏的次数，`repost_count` 是被转发的次数；前者高说明内容有留存价值，后者高说明传播性强。和 `like_count` 放在一起看，比只看赞同数更能分清「有用」和「有共鸣」。再把赞同数除以 `author_follower_count`，能分清是内容本身受欢迎，还是账号粉丝多。`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
