---
title: "user_posts · API 参考 · 文档 · SocialToAI"
canonical: https://socialtoai.app/zh/docs/api/user-posts/
updated: 2026-11-20
---

# user_posts

POST /v1/user_posts 是“账号作品”动作：一个账号发过的内容。目前在 17 个平台上开放（TikTok、Instagram、X、Reddit、YouTube、Facebook 等），平台是请求里的一个参数。每次调用 2 到 12 积分，因平台而异；失败的调用不扣。

- 页面：https://socialtoai.app/zh/docs/api/user-posts/
- 最近更新：2026-11-20

- POST: `https://socialtoai.app/v1/user_posts`

## 请求

请求体是 JSON。下面这几项每个动作都一样，其余的参数因平台而异，见后文。

| 名称 | 类型 | 位置 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `platform` | string | 请求体 | 是 | 要读的平台，取这个动作已开放的平台之一。 |
| `limit` | integer | 请求体 | 否 | search、trending、comments、user_posts 才有：想要多少条。一次调用里一页接一页地取，直到够数或没有更多；每页按一次调用计费，用不上的页不扣。 |
| `max_cost_credits` | integer | 请求体 | 否 | 这次调用最多花多少积分。超出时免费拒绝，并在返回里给出报价。 |
| `Idempotency-Key` | string | 请求头 | 否 | 1 到 255 个可见 ASCII 字符。同一个键加同样的参数会返回第一次的结果，不会重复扣费。 |

## 平台与积分

每个平台收的参数不同。平台自己的页面上有完整的参数表、字段表和可以改的请求。

| 平台 | 价格键 | 积分 | 必填 | 可选 | 每页 |
| --- | --- | --- | --- | --- | --- |
| [TikTok](https://socialtoai.app/zh/tiktok-user-posts-api.md) | `tiktok.user_posts` | 2 | `username` | `sort` | 10 |
| [Instagram](https://socialtoai.app/zh/instagram-user-posts-api.md) | `instagram.user_posts` | 2 | `username` | `type` | 12 |
| [X](https://socialtoai.app/zh/x-user-posts-api.md) | `x.user_posts` | 2 | `username` | `tab` | 60 |
| [Reddit](https://socialtoai.app/zh/reddit-user-posts-api.md) | `reddit.user_posts` | 2 | `username` | – | 25 |
| [YouTube](https://socialtoai.app/zh/youtube-user-posts-api.md) | `youtube.user_posts` | 2 | `id`、`username` 里给一个 | `type`、`sort` | 60 |
| [Facebook](https://socialtoai.app/zh/facebook-user-posts-api.md) | `facebook.user_posts` | 2 | `id`、`username`、`url` 里给一个 | – | 3 |
| [LinkedIn](https://socialtoai.app/zh/linkedin-user-posts-api.md) | `linkedin.user_posts` | 2 | `username`、`url` 里给一个 | – | 10 |
| [Threads](https://socialtoai.app/zh/threads-user-posts-api.md) | `threads.user_posts` | 2 | `username` | – | 30 |
| [Telegram](https://socialtoai.app/zh/telegram-user-posts-api.md) | `telegram.user_posts` | 2 | `username` | – | 20 |
| [小红书](https://socialtoai.app/zh/xiaohongshu-user-posts-api.md) | `xiaohongshu.user_posts` | 12 | `id`、`url` 里给一个 | – | 30 |
| [抖音](https://socialtoai.app/zh/douyin-user-posts-api.md) | `douyin.user_posts` | 2 | `id`、`url` 里给一个 | – | 20 |
| [微博](https://socialtoai.app/zh/weibo-user-posts-api.md) | `weibo.user_posts` | 2 | `id` | – | 25 |
| [公众号](https://socialtoai.app/zh/wechat-user-posts-api.md) | `wechat.user_posts` | 12 | `id` | `tab` | 20 |
| [B 站](https://socialtoai.app/zh/bilibili-user-posts-api.md) | `bilibili.user_posts` | 2 | `id` | – | 30 |
| [知乎](https://socialtoai.app/zh/zhihu-user-posts-api.md) | `zhihu.user_posts` | 2 | `username` | – | 20 |
| [快手](https://socialtoai.app/zh/kuaishou-user-posts-api.md) | `kuaishou.user_posts` | 12 | `id` | – | 20 |
| [视频号](https://socialtoai.app/zh/wechat-channels-user-posts-api.md) | `wechat_channels.user_posts` | 12 | `id` | – | 30 |

有些平台的这个动作还有另一种取值，由某个参数选中，单独计价：

| 平台 | 价格键 | 积分 | 由什么选中 |
| --- | --- | --- | --- |
| 知乎 | `zhihu.user_posts:answers` | 2 | `type=answer` |
| 知乎 | `zhihu.user_posts:pins` | 2 | `type=pin` |

## 参数

| 名称 | 类型 | 说明 | 哪些平台收 |
| --- | --- | --- | --- |
| `username` | string | TikTok 账号名，不带 @ | TikTok、Instagram、X、Reddit、YouTube、Facebook、LinkedIn、Threads、Telegram和知乎 |
| `sort` | string | 按发布时间排，或按热门排取值因平台而异：`latest`、`popular` | TikTok和YouTube |
| `type` | string | 全部帖子，或只要 Reels 短视频取值因平台而异：`all`、`reel`、`video`、`short` | Instagram和YouTube |
| `tab` | string | 主页上的哪个分栏：帖子（含转推）、回复（只给这个账号自己发的，被回复的别人的帖子不给，用 parent_id 找）、媒体取值因平台而异：`posts`、`replies`、`media`、`articles`、`videos`、`images` | X和公众号 |
| `id` | string | 频道编号，UC 开头 | YouTube、Facebook、小红书、抖音、微博、公众号、B 站、快手和视频号 |
| `url` | string | 主页链接，facebook.com/账号名 的写法 | Facebook、LinkedIn、小红书和抖音 |

## 示例

TikTok：一个账号最近发布的视频。

**cURL**

```
curl https://socialtoai.app/v1/user_posts \
  -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "tiktok",
    "username": "nasa"
  }'
```

**Python**

```
import os
import uuid
import requests

response = requests.post(
    "https://socialtoai.app/v1/user_posts",
    headers={
        "Authorization": f"Bearer {os.environ['SOCIALTOAI_API_KEY']}",
        # A new key for each request; the same one again retries it without paying twice.
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "platform": "tiktok",
        "username": "nasa",
    },
)
print(response.json())
```

**返回** (200 OK, 2 积分)

```
{
  "request_id": "req_00000000-0000-4000-8000-000000000001",
  "schema_version": "v1",
  "fetched_at": "2026-10-12T18:45:11.000Z",
  "action": "user_posts",
  "platform": "tiktok",
  "status": "ok",
  "items": [
    {
      "platform": "tiktok",
      "id": "…",
      "ref": "…",
      "approx": [],
      "extra": {},
      "type": "content",
      "url": "https://example.com/…",
      "format": "video",
      "title": null,
      "text": "…",
      "published_at": "2026-07-21T20:09:02.000Z",
      "author": {
        "id": "…",
        "username": "…",
        "name": "…",
        "verified": null,
        "followers": 2060928
      },
      "metrics": {
        "likes": 103312,
        "comments": 3021,
        "shares": 3253,
        "collects": 7513,
        "views": 1592522,
        "reposts": null
      },
      "images": null,
      "hashtags": [],
      "is_pinned": true
    }
  ],
  "unavailable": ["title", "author.verified", "metrics.reposts", "images"],
  "page": {
    "has_more": true,
    "cursor": "cur_…",
    "cursor_expires_at": "2026-10-12T19:15:11.000Z"
  },
  "warnings": [],
  "applied_params": {
    "username": "nasa"
  },
  "cost_credits": 2,
  "billing": {
    "cost_credits": 2,
    "balance_credits": 98,
    "today_spend_credits": 2,
    "daily_limit_credits": null,
    "daily_remaining_credits": null,
    "display": "本次 2 积分（约 $0.0067），余额 98 积分（约 $0.33）"
  },
  "replayed": false
}
```

_示例数据：名字、链接和正文已换成占位符。_

## 返回什么

返回[外层结构](https://socialtoai.app/zh/docs/api/response.md)，`items` 里是 [`content`](https://socialtoai.app/zh/docs/api/response.md) 对象。一次调用返回一页，最多 10 条；每一页是一次调用。cursor 最长 30 分钟内有效。

失败的调用是 0 积分，并说明原因，见[错误](https://socialtoai.app/zh/docs/api/errors.md)。
