# 快手 用户内容 API (kuaishou.user_posts)

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

快手用户内容按 `user_id` 列出一个作者主页上的视频，每条带文案、时长 `duration_ms`、点赞评论分享数、发布时间和封面图，作者的粉丝数和累计作品数也随行返回。它回答「这个创作者最近在发什么、哪类作品反响好」，适合达人筛选、竞品账号监测和投放前的内容核查。

`user_id` 可以填快手用户 ID，也可以直接填主页链接，/profile/ 和 /@ 两种写法都收；关键词搜索结果里的 `author_id`、`author_url` 拿来就能用。作者自定义的快手号在 `author_kwai_id`，认证状态看 `author_verified`；`transcript` 只在有口播转写数据时返回，同一个账号的视频可能只有一部分带转写。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| user_id | not declared | yes | not declared | 快手用户 ID 或作者主页链接（支持 /profile/{id} 与 /@{user} 两种形式），user_posts 从该主页取视频；可从视频搜索结果的 author_id / author_url 直接取得。 |
| limit | integer (1–100) | no | 20 | 这次调用最多返回的条数，整数，1–100；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| duration_ms | 时长，**毫秒**。 |
| view_count | 这条热点的浏览量（hot_boards）。 |
| like_count | 点赞数。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| share_count | 分享/转发数。null 表示不公开，不等于 0。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_name | 作者昵称（显示名）。 |
| author_kwai_id | 快手号（用户自定义 ID）。 |
| author_url | 作者在原平台的主页链接。 |
| author_verified | 作者是否认证（comments 上是评论者）。 |
| follower_count | 粉丝数（search、user_posts 是作者的；user_search 是这个账号的）。 |
| video_count | 累计作品数（search、user_posts 是作者的；user_live、user_search 是这个账号的）。 |
| cover_url | 封面图（trending 上是这条热点的配图）。 |
| avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接，可能有时效。 |
| transcript | 视频口播文案转写（有数据时返回）。 |
| 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": "kuaishou",
  "action": "user_posts",
  "params": {
    "user_id": "2542916559"
  }
}'
```

```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": "kuaishou",
        "action": "user_posts",
        "params": {
            "user_id": "2542916559",
        },
    },
    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": "kuaishou",
  "action": "user_posts",
  "results": [
    {
      "id": …,
      "url": …,
      "text": …,
      "duration_ms": …,
      "view_count": …,
      "like_count": …,
      "comment_count": …,
      "share_count": …,
      "posted_at": …,
      "author_id": …,
      "author_name": …,
      "author_kwai_id": …,
      "author_url": …,
      "author_verified": …,
      "follower_count": …,
      "video_count": …,
      "cover_url": …,
      "avatar_url": …,
      "transcript": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `user_id` 从哪里拿？

三种来源都行：快手用户 ID、作者主页链接（/profile/ 后面跟 ID，或 /@ 后面跟用户名），以及关键词搜索结果里每条视频的 `author_id`、`author_url`。手里只有一个话题时，先搜索再取作者。参数示例填的就是 2542916559 这样的纯数字 ID，`author_url` 本身是作者主页链接，不用自己拼；`author_id` 是作者在原平台的唯一 ID，同一个作者不论从哪条视频进来都是同一个值。

### 怎么判断一个账号哪类视频表现好？

把列表按 `like_count`、`comment_count`、`share_count` 排序，再对照 `text` 和 `duration_ms` 看高互动作品的题材和时长。同一账号内比较最公平，因为粉丝基数相同。`comment_count` 和 `share_count` 为 null 表示不公开，不等于 0；`posted_at` 是 UTC 时间，按发布时段统计前先换算成本地时区。

### 用户内容和关键词搜索该先用哪个？

已经知道要看哪个作者，直接用用户内容；还不知道是谁，先用关键词搜索按话题找视频，从结果里挑作者。用户内容只返回这个作者的作品，不会混进别人的视频。两个接口的返回字段相同，从搜索接过来时解析代码不用改；高互动的视频有 `transcript` 时，可以拿来核对视频里到底说了什么。做账号盘点时，`cover_url` 是封面图，可以和 `text` 一起存档。

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=kuaishou
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
