# comments

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

- 页面：https://socialtoai.com/zh/docs/api/comments/
- 最近更新：2026-10-17

- POST: `https://api.socialtoai.com/v1/comments`

## 请求

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

| 名称 | 类型 | 位置 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `platform` | string | 请求体 | 是 | 要读的平台，取这个动作已开放的平台之一。 |
| `max_cost_credits` | integer | 请求体 | 否 | 这次调用最多花多少积分。超出时免费拒绝，并在返回里给出报价。 |
| `Idempotency-Key` | string | 请求头 | 否 | 1 到 255 个可见 ASCII 字符。同一个键加同样的参数会返回第一次的结果，不会重复扣费。 |

## 平台与积分

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

| 平台 | 价格键 | 积分 | 必填 | 可选 | 每页 |
| --- | --- | --- | --- | --- | --- |
| [TikTok](https://socialtoai.com/zh/tiktok-comments-api.md) | `tiktok.comments` | 2 | `id`、`url` 里给一个 | – | 50 |
| [Instagram](https://socialtoai.com/zh/instagram-comments-api.md) | `instagram.comments` | 2 | `id`、`url` 里给一个 | – | 15 |
| [X](https://socialtoai.com/zh/x-comments-api.md) | `x.comments` | 2 | `id` | – | 60 |
| [Reddit](https://socialtoai.com/zh/reddit-comments-api.md) | `reddit.comments` | 2 | `id`、`url` 里给一个 | `sort` | 200 |
| [YouTube](https://socialtoai.com/zh/youtube-comments-api.md) | `youtube.comments` | 2 | `id`、`url` 里给一个 | `sort` | 20 |
| [Facebook](https://socialtoai.com/zh/facebook-comments-api.md) | `facebook.comments` | 2 | `id` | – | 10 |
| [小红书](https://socialtoai.com/zh/xiaohongshu-comments-api.md) | `xiaohongshu.comments` | 12 | `id`、`url` 里给一个 | – | 20 |
| [抖音](https://socialtoai.com/zh/douyin-comments-api.md) | `douyin.comments` | 2 | `id` | – | 20 |
| [微博](https://socialtoai.com/zh/weibo-comments-api.md) | `weibo.comments` | 2 | `id` | – | 20 |
| [公众号](https://socialtoai.com/zh/wechat-comments-api.md) | `wechat.comments` | 12 | `url` | – | 20 |
| [B 站](https://socialtoai.com/zh/bilibili-comments-api.md) | `bilibili.comments` | 2 | `id` | – | 20 |
| [知乎](https://socialtoai.com/zh/zhihu-comments-api.md) | `zhihu.comments` | 2 | `id` | – | 20 |
| [快手](https://socialtoai.com/zh/kuaishou-comments-api.md) | `kuaishou.comments` | 2 | `id` | – | 40 |
| [视频号](https://socialtoai.com/zh/wechat-channels-comments-api.md) | `wechat_channels.comments` | 12 | `id` | – | 30 |

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

| 平台 | 价格键 | 积分 | 由什么选中 |
| --- | --- | --- | --- |
| TikTok | `tiktok.comments:replies` | 2 | `reply_of` |
| Instagram | `instagram.comments:replies` | 2 | `reply_of` |
| YouTube | `youtube.comments:replies` | 2 | `reply_of` |
| 小红书 | `xiaohongshu.comments:replies` | 12 | `reply_of` |
| 抖音 | `douyin.comments:replies` | 2 | `reply_of` |
| B 站 | `bilibili.comments:replies` | 2 | `reply_of` |
| 知乎 | `zhihu.comments:replies` | 2 | `reply_of` |
| 快手 | `kuaishou.comments:replies` | 2 | `reply_of` |

## 参数

| 名称 | 类型 | 说明 | 哪些平台收 |
| --- | --- | --- | --- |
| `id` | string | 视频编号，一串数字 | TikTok、Instagram、X、Reddit、YouTube、Facebook、小红书、抖音、微博、B 站、知乎、快手和视频号 |
| `url` | string | 视频的网页链接 | TikTok、Instagram、Reddit、YouTube、小红书和公众号 |
| `reply_of` | string | 评论编号，一串数字 | TikTok、Instagram、YouTube、小红书、抖音、B 站、知乎和快手 |
| `sort` | string | 按 Reddit 的默认排序（best）、最新或最高分排取值因平台而异：`best`、`latest`、`popular` | Reddit和YouTube |

## 示例

TikTok：一条视频下的评论：正文、点赞数、回复数和时间。

**cURL**

```
curl https://api.socialtoai.com/v1/comments \
  -H "Authorization: Bearer $SOCIALTOAI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "tiktok",
    "id": "7665840565958872333"
  }'
```

**Python**

```
import os
import requests

response = requests.post(
    "https://api.socialtoai.com/v1/comments",
    headers={"Authorization": f"Bearer {os.environ['SOCIALTOAI_KEY']}"},
    json={
        "platform": "tiktok",
        "id": "7665840565958872333",
    },
)
print(response.json())
```

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

```
{
  "request_id": "req_00000000-0000-4000-8000-000000000001",
  "schema_version": "v1",
  "fetched_at": "2026-10-12T18:45:47.000Z",
  "action": "comments",
  "platform": "tiktok",
  "status": "ok",
  "items": [
    {
      "platform": "tiktok",
      "id": "…",
      "ref": "…",
      "approx": [],
      "type": "comment",
      "url": null,
      "text": "…",
      "published_at": "2026-10-08T14:20:19.000Z",
      "author": {
        "label": "anonymous_1"
      },
      "metrics": {
        "likes": 1430
      },
      "reply_count": 37,
      "content_id": "…",
      "parent_id": null,
      "root_id": null
    }
  ],
  "unavailable": ["url"],
  "page": {
    "has_more": true,
    "cursor": "cur_…",
    "cursor_expires_at": "2026-10-12T19:15:47.000Z"
  },
  "warnings": [],
  "applied_params": {
    "id": "7665840565958872333"
  },
  "cost_credits": 2,
  "billing": {
    "cost_credits": 2,
    "balance_credits": 98,
    "today_spend_credits": 2,
    "daily_limit_credits": null,
    "daily_remaining_credits": null,
    "display": "本次 2 积分，余额 98 积分"
  },
  "replayed": false
}
```

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

## 返回什么

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

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