# 小红书笔记评论怎么批量获取

传笔记 ID，用 `data.next` 翻页。实测第一页 10 条、之后每页 15 条，10 页约 145 条评论，10 次调用、$0.20，不用小红书 cookie，也不用算 x-s 签名。

更新于 2026-11-22

## 翻完全部评论

`id` 填笔记 ID：笔记链接里 `/explore/` 或 `/discovery/item/` 后面那 24 位字符。也可以把分享链接传给 `url`。小红书返回的游标是一小段 JSON 字符串，放在 `data.next` 里原样传回就行。

[小红书笔记评论](https://xtikapi.com/zh/apis/xiaohongshu/comments/list): `GET /v1/xiaohongshu/comments/list`, $0.02 / 次

```bash
curl "https://xtikapi.com/v1/xiaohongshu/comments/list?id=6aaf9168000000002b01c2bc" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```python
import requests

URL = "https://xtikapi.com/v1/xiaohongshu/comments/list"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}

params = {"id": "6aaf9168000000002b01c2bc"}
items = []
for _ in range(10):  # one call per page
    for attempt in range(3):  # 5xx errors are not charged: retry
        response = requests.get(URL, params=params, headers=HEADERS, timeout=60)
        if response.status_code < 500:
            break
    response.raise_for_status()
    data = response.json()["data"]
    items += data["items"]
    if not data.get("next"):  # null on the last page
        break
    params.update(data["next"])

print(len(items), "items")
```

```javascript
const URL = "https://xtikapi.com/v1/xiaohongshu/comments/list";
const HEADERS = { Authorization: "Bearer YOUR_API_KEY" };

let params = {"id":"6aaf9168000000002b01c2bc"};
const items = [];
for (let page = 0; page < 10; page++) {
  let response;
  for (let attempt = 0; attempt < 3; attempt++) {
    // 5xx errors are not charged: retry
    response = await fetch(`${URL}?${new URLSearchParams(params)}`, { headers: HEADERS });
    if (response.status < 500) break;
  }
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  const { data } = await response.json();
  items.push(...data.items);
  if (!data.next) break; // null on the last page
  params = { ...params, ...data.next };
}
console.log(items.length, "items");
```

录制的真实返回（列表只保留前两条）：

```json
{
  "data": {
    "items": [
      {
        "id": "9xx5xx109630741864998711",
        "text": "Example text",
        "author": {
          "id": "x9396x7xx0x02193x19362x0xx559",
          "username": "example_user",
          "name": "Example name",
          "avatar": "https://example.com/image.jpg"
        },
        "createdAt": "2026-10-28T12:32:42.000Z",
        "likeCount": 0,
        "replyCount": 1
      },
      {
        "id": "9xx8x71x96307418649651x1",
        "text": "Example text",
        "author": {
          "id": "x7x237x10336x2x6xxx1228xxxxxx",
          "username": "example_user",
          "name": "Example name",
          "avatar": "https://example.com/image.jpg"
        },
        "createdAt": "2026-10-18T12:19:57.000Z",
        "likeCount": 0,
        "replyCount": 0
      }
    ],
    "has_more": true,
    "next": {
      "cursor": "{\"contextId\"…"
    }
  },
  "meta": {
    "request_id": "example",
    "endpoint": "xiaohongshu.comments.list",
    "normalized": true,
    "unavailable": [],
    "billing": {
      "charged": true,
      "amount": 0.02,
      "balance": 4.98
    }
  }
}
```

## 这个例子花多少钱

| 步骤 | 调用次数 | 单价 | 小计 |
| --- | --- | --- | --- |
| 评论，10 页、每页 10～15 条 | 10 | $0.02 | $0.2 |
| 合计 | 10 | | $0.20 |

## 要注意的地方

- 2026-11-22 实测第一页 10 条、第二页 15 条，两页没有重复。
- 子评论要单独取：`xiaohongshu.comment_replies.list`，传笔记和评论的 `id`。
- 每页 $0.02，是抖音评论的 10 倍，因为上游读取成本更高。
- 传 `sort_strategy: like_count` 按点赞数排；默认按最新排。

## 用到的接口

- [小红书笔记评论](https://xtikapi.com/zh/apis/xiaohongshu/comments/list): $0.02 / 次

## 小红书的更多内容

- [小红书博主全部笔记怎么导出](https://xtikapi.com/zh/guides/xiaohongshu-user-notes)
- [MediaCrawler 常见报错排查（Verifytype、抖音 page 1 empty、小红书 406、快手）与托管替代](https://xtikapi.com/zh/answers/mediacrawler-errors-and-alternatives)
- [xiaohongshu-mcp 常见报错排查：300011、登录失效、被封号与 search_feeds 超时](https://xtikapi.com/zh/answers/xiaohongshu-mcp-errors-and-fixes)
- [小红书提示检测到 AI 操作或自动化行为，还能怎么采集数据](https://xtikapi.com/zh/answers/xiaohongshu-ai-operation-detected)
- [小红书二级评论接口返回 code -1、success false 是什么原因](https://xtikapi.com/zh/answers/xiaohongshu-comment-replies-code-minus-1)
- [n8n 怎么自动采集小红书笔记](https://xtikapi.com/zh/answers/n8n-xiaohongshu-notes)
- [Spider_XHS 部署到服务器后 Cookie 失效怎么办](https://xtikapi.com/zh/answers/spider-xhs-cookie-invalid-on-server)

## 常见问题

### 用 XTikAPI 做这件事要花多少钱？

按本文的例子是 10 次调用，共 $0.20。失败和超时不收费；验证过邮箱的新账号送 $0.50 试用额度。

### 笔记 ID 在哪看？

用浏览器打开笔记，链接里 /explore/ 后面那 24 位字符就是。在 App 里就复制分享链接，传给 url。

---

XTikAPI: one API key for public social media data, prepaid per call. [HTML version](https://xtikapi.com/zh/guides/xiaohongshu-note-comments) · [llms.txt](https://xtikapi.com/llms.txt) · [OpenAPI](https://xtikapi.com/openapi.json)
