> ## Documentation Index
> Fetch the complete documentation index at: https://docs.socialvision.tisyk.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# 小红书 (Xiaohongshu) 接口

> 小红书笔记搜索、详情、评论、博主主页及蒲公英商业分析核心端点

## 接口列表概览

SocialVision 提供经过逆向穿透的小红书全维度数据提取接口。通过统一网关 `POST /api/v1/run` 调用，只有成功返回 2xx 且有数据时才扣减 0.10 Credits。

### 获取笔记评论列表/Get note comments

`0.10 Credits / 次`

`/api/v1/xiaohongshu/app_v2/get_note_comments`

# \[中文]

### 用途:

* 获取指定笔记的评论列表，支持分页和多种排序方式

### ⚠️ 计费提示:

* 如果传入错误或不存在的笔记ID（或分享链接解析失败），接口仍会正常响应，但 `data` 中会返回上游"服务异常"信息，该请求 **同样会正常计费扣费**，请在调用前确保参数有效。

### 参数:

* note\_id: 笔记ID，如 "697c0eee000000000a03c308"
* share\_text: 小红书分享链接，支持APP和Web端分享链接，支持 `xiaohongshu.com` 长链接、`xhslink.com` 和 `xhslink.cn` 短链接
* 优先使用`note_id`，如果没有则使用`share_text`，两个参数二选一，如都携带则以`note_id`为准。
* cursor: 分页游标，首次请求留空，翻页时传入上一次响应中返回的 cursor 值
* index: 评论索引，首次请求传 0，翻页时传入上一次响应中返回的 index 值
* pageArea: 折叠状态，默认 "UNFOLDED"（展开），翻页时传入上一次响应中返回的 pageArea 值
* sort\_strategy: 排序策略
  * "latest\_v2": 按时间倒序（最新，默认使用）
  * "like\_count": 按点赞数排序（最热）
  * "default": 默认排序（不推荐，翻页时会丢失评论或重复抓取评论）

### 返回:

* 评论数据对象，包含评论列表、分页游标等

### 翻页说明:

* 首次请求：cursor留空，index传0
* 翻页请求：传入上一次响应中返回的 cursor 和 index 和 pageArea 值
* 翻页所需字段通常位于响应的 `$.data.data` 对象中（如 cursor ← `$.data.data.cursor`），请从上一次响应中提取对应值传入

# \[English]

### Purpose:

* Get comment list for a specified note, supports pagination and multiple sort strategies

### ⚠️ Billing Notice:

* If a wrong or non-existent note ID is passed (or the share link fails to parse), the endpoint still responds normally, but the `data` field will contain an upstream "service error" message. Such requests **will still be billed as normal**. Please make sure the parameters are valid before calling.

### Parameters:

* note\_id: Note ID, e.g. "697c0eee000000000a03c308"
* share\_text: Xiaohongshu sharing link, supports APP and Web sharing links, including `xiaohongshu.com` full links, `xhslink.com` and `xhslink.cn` short links
* Prefer to use `note_id`, if not, use `share_text`, one of the two parameters is required, if both are carried, `note_id` shall prevail.
* cursor: Pagination cursor, leave empty for first request, pass cursor value from previous response for next page
* index: Comment index, pass 0 for first request, pass index value from previous response for next page
* pageArea: Fold status, default "UNFOLDED" (unfolded), pass pageArea value from previous response for next page
* sort\_strategy: Sort strategy
  * "latest\_v2": Sort by time desc (latest, recommended default)
  * "like\_count": Sort by like\_count
  * "default": Sort by default (not recommended, may cause missing or duplicate comments when paginating)

### Return:

* Comments data object, including comment list, pagination cursor, etc.

### Pagination Guide:

* First request: leave cursor empty, pass index as 0
* Next page: pass cursor and index and pageArea values from previous response
* The pagination fields are usually located in the `$.data.data` object of the response (e.g. cursor ← `$.data.data.cursor`), extract the corresponding values from the previous response

# \[示例/Example]

note\_id="697c0eee000000000a03c308"
sort\_strategy="latest\_v2"

#### 输入参数 (input 对象)

| 参数名             | 类型        | 必填 | 说明                                                                                                          |
| :-------------- | :-------- | :- | :---------------------------------------------------------------------------------------------------------- |
| `note_id`       | `string`  | 否  | 笔记ID/Note ID                                                                                                |
| `share_text`    | `string`  | 否  | 分享链接，支持xiaohongshu.com/xhslink.com/xhslink.cn/Share link, supports xiaohongshu.com, xhslink.com, xhslink.cn |
| `cursor`        | `string`  | 否  | 分页游标，首次请求留空/Pagination cursor, leave empty for first request                                                |
| `index`         | `integer` | 否  | 评论索引，首次请求传0/Comment index, pass 0 for first request                                                         |
| `pageArea`      | `string`  | 否  | 折叠状态: UNFOLDED(默认-展开), FOLDED(折叠)                                                                           |
| `sort_strategy` | `string`  | 否  | 排序策略/Sort strategy: default, latest\_v2, like\_count                                                        |

```bash cURL theme={null}
curl -X POST https://socialvision.tisyk.xyz/api/v1/run \
  -H "Authorization: Bearer sv_live_你的API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "provider": "tikhub",
  "endpoint": "/api/v1/xiaohongshu/app_v2/get_note_comments",
  "input": {
    "note_id": "697c0eee000000000a03c308",
    "share_text": "http://xhslink.com/o/8GqargIxrko",
    "cursor": "示例值",
    "index": 1,
    "pageArea": "UNFOLDED",
    "sort_strategy": "latest_v2"
  }
}'
```

```python Python theme={null}
import requests

res = requests.post(
    "https://socialvision.tisyk.xyz/api/v1/run",
    headers={
        "Authorization": "Bearer sv_live_你的API_KEY",
        "Content-Type": "application/json"
    },
    json={
  "provider": "tikhub",
  "endpoint": "/api/v1/xiaohongshu/app_v2/get_note_comments",
  "input": {
    "note_id": "697c0eee000000000a03c308",
    "share_text": "http://xhslink.com/o/8GqargIxrko",
    "cursor": "示例值",
    "index": 1,
    "pageArea": "UNFOLDED",
    "sort_strategy": "latest_v2"
  }
}
)
print(res.json())
```

***

### 获取用户信息/Get user info

`0.10 Credits / 次`

`/api/v1/xiaohongshu/app_v2/get_user_info`

# \[中文]

### 用途:

* 获取指定用户的详细信息

### ⚠️ 注意事项（重要）:

* 请务必确保传入的 `user_id` 正确有效。如果传入错误或不存在的用户ID，接口仍会正常响应，但 `data` 中会返回小红书官方的"服务异常"信息。
* 由于请求已实际发出并成功返回，此类请求 **同样会正常计费扣费**，请在调用前自行校验用户ID的有效性。

### 参数:

* user\_id: 用户ID，如 "61b46d790000000010008153"
* share\_text: 小红书分享链接，支持APP和Web端分享链接，支持 `xiaohongshu.com` 长链接、`xhslink.com` 和 `xhslink.cn` 短链接
* 优先使用`user_id`，如果没有则使用`share_text`，两个参数二选一，如都携带则以`user_id`为准。

### 返回:

* 用户详细信息，包含昵称、头像、简介、粉丝数、关注数、笔记数等

# \[English]

### Purpose:

* Get detailed info of a specified user

### ⚠️ Notice (Important):

* Make sure the `user_id` you pass is correct and valid. If a wrong or non-existent user ID is passed, the endpoint will still respond normally, but the `data` field will contain a "service error" message from Xiaohongshu official.
* Since the request has actually been sent and returned successfully, such requests **will still be billed as normal**. Please validate the user ID before calling.

### Parameters:

* user\_id: User ID, e.g. "61b46d790000000010008153"
* share\_text: Xiaohongshu sharing link, supports APP and Web sharing links, including `xiaohongshu.com` full links, `xhslink.com` and `xhslink.cn` short links
* Prefer to use `user_id`, if not, use `share_text`, one of the two parameters is required, if both are carried, `user_id` shall prevail.

### Return:

* User detailed info, including nickname, avatar, bio, follower count, following count, note count, etc.

# \[示例/Example]

user\_id="61b46d790000000010008153"

#### 输入参数 (input 对象)

| 参数名          | 类型       | 必填 | 说明                                                                                                          |
| :----------- | :------- | :- | :---------------------------------------------------------------------------------------------------------- |
| `user_id`    | `string` | 否  | 用户ID/User ID                                                                                                |
| `share_text` | `string` | 否  | 分享链接，支持xiaohongshu.com/xhslink.com/xhslink.cn/Share link, supports xiaohongshu.com, xhslink.com, xhslink.cn |

```bash cURL theme={null}
curl -X POST https://socialvision.tisyk.xyz/api/v1/run \
  -H "Authorization: Bearer sv_live_你的API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "provider": "tikhub",
  "endpoint": "/api/v1/xiaohongshu/app_v2/get_user_info",
  "input": {
    "user_id": "61b46d790000000010008153",
    "share_text": "https://xhslink.com/m/3ZSCJZAMz0a"
  }
}'
```

```python Python theme={null}
import requests

res = requests.post(
    "https://socialvision.tisyk.xyz/api/v1/run",
    headers={
        "Authorization": "Bearer sv_live_你的API_KEY",
        "Content-Type": "application/json"
    },
    json={
  "provider": "tikhub",
  "endpoint": "/api/v1/xiaohongshu/app_v2/get_user_info",
  "input": {
    "user_id": "61b46d790000000010008153",
    "share_text": "https://xhslink.com/m/3ZSCJZAMz0a"
  }
}
)
print(res.json())
```

***

### 搜索笔记/Search notes

`0.10 Credits / 次`

`/api/v1/xiaohongshu/app_v2/search_notes`

# \[中文]

### 用途:

* 根据关键词搜索小红书笔记，支持多种排序方式、笔记类型筛选和发布时间筛选

### 参数:

* keyword: 搜索关键词（必需），如 "美食推荐"
* page: 页码，从 1 开始
* sort\_type: 排序方式
  * "general": 综合排序（默认）
  * "time\_descending": 按时间倒序（最新）
  * "popularity\_descending": 按点赞数排序（最多点赞）
  * "comment\_descending": 按评论数排序（最多评论）
  * "collect\_descending": 按收藏数排序（最多收藏）
  * "english\_preferred": 英文优先
* note\_type: 笔记类型筛选
  * "不限": 所有类型（默认）
  * "视频笔记": 仅视频
  * "普通笔记": 仅图文
  * "直播笔记": 仅直播
* time\_filter: 发布时间筛选
  * "不限": 所有时间（默认）
  * "一天内": 24小时内
  * "一周内": 7天内
  * "半年内": 6个月内
* search\_id: 搜索ID，翻页时传入首次搜索返回的值
* search\_session\_id: 搜索会话ID，翻页时传入首次搜索返回的值
* source: 来源，默认 "explore\_feed"
* ai\_mode: AI模式，0=关闭, 1=开启

### 返回:

* 搜索结果数据，包含笔记列表和分页信息

### 翻页说明:

* 首次请求：只传keyword和page
* 翻页请求：传入首次搜索返回的 search\_id 和 search\_session\_id

# \[English]

### Purpose:

* Search Xiaohongshu notes by keyword, supports multiple sort types, note type filters, and time filters

### Parameters:

* keyword: Search keyword (required), e.g. "美食推荐"
* page: Page number, start from 1
* sort\_type: Sort type
  * "general": General sort (default)
  * "time\_descending": Sort by time descending (latest)
  * "popularity\_descending": Sort by like count (most liked)
  * "comment\_descending": Sort by comment count (most commented)
  * "collect\_descending": Sort by collect count (most collected)
  * "english\_preferred": English preferred
* note\_type: Note type filter
  * "不限": All types (default)
  * "视频笔记": Video notes only
  * "普通笔记": Image notes only
  * "直播笔记": Live notes only
* time\_filter: Time filter
  * "不限": All time (default)
  * "一天内": Within 24 hours
  * "一周内": Within 7 days
  * "半年内": Within 6 months
* search\_id: Search ID, pass value from first search response for pagination
* search\_session\_id: Search session ID, pass value from first search response for pagination
* source: Source, default "explore\_feed"
* ai\_mode: AI mode, 0=off, 1=on

### Return:

* Search result data, including note list and pagination info

### Pagination Guide:

* First request: only pass keyword and page
* Next page: pass search\_id and search\_session\_id from first search response

# \[示例/Example]

keyword="美食推荐"
page=1
sort\_type="general"

#### 输入参数 (input 对象)

| 参数名                 | 类型        | 必填 | 说明                                                    |
| :------------------ | :-------- | :- | :---------------------------------------------------- |
| `keyword`           | `string`  | 是  | 搜索关键词/Search keyword                                  |
| `page`              | `integer` | 否  | 页码，从1开始/Page number, start from 1                     |
| `sort_type`         | `string`  | 否  | 排序方式/Sort type                                        |
| `note_type`         | `string`  | 否  | 笔记类型/Note type: 不限, 视频笔记, 普通笔记, 直播笔记                  |
| `time_filter`       | `string`  | 否  | 发布时间筛选/Time filter: 不限, 一天内, 一周内, 半年内                 |
| `search_id`         | `string`  | 否  | 搜索ID，翻页时传入首次搜索返回的值/Search ID for pagination           |
| `search_session_id` | `string`  | 否  | 搜索会话ID，翻页时传入首次搜索返回的值/Search session ID for pagination |
| `source`            | `string`  | 否  | 来源/Source                                             |
| `ai_mode`           | `integer` | 否  | AI模式：0=关闭, 1=开启/AI mode: 0=off, 1=on                  |

```bash cURL theme={null}
curl -X POST https://socialvision.tisyk.xyz/api/v1/run \
  -H "Authorization: Bearer sv_live_你的API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "provider": "tikhub",
  "endpoint": "/api/v1/xiaohongshu/app_v2/search_notes",
  "input": {
    "keyword": "美食推荐",
    "page": 1,
    "sort_type": "general",
    "note_type": "不限",
    "time_filter": "不限",
    "search_id": "示例值",
    "search_session_id": "示例值",
    "source": "explore_feed",
    "ai_mode": 1
  }
}'
```

```python Python theme={null}
import requests

res = requests.post(
    "https://socialvision.tisyk.xyz/api/v1/run",
    headers={
        "Authorization": "Bearer sv_live_你的API_KEY",
        "Content-Type": "application/json"
    },
    json={
  "provider": "tikhub",
  "endpoint": "/api/v1/xiaohongshu/app_v2/search_notes",
  "input": {
    "keyword": "美食推荐",
    "page": 1,
    "sort_type": "general",
    "note_type": "不限",
    "time_filter": "不限",
    "search_id": "示例值",
    "search_session_id": "示例值",
    "source": "explore_feed",
    "ai_mode": 1
  }
}
)
print(res.json())
```

***
