---
name: socialdatax-xhs-search
description: 用于小红书数据分析、小红书笔记搜索、关键词检索、内容调研、竞品分析和趋势研究。覆盖 Xiaohongshu / XHS / RedNote note search，来自 SocialDataX 社媒数据助手。
metadata: {"openclaw":{"requires":{"env":["SOCIALDATAX_API_KEY"],"bins":["node","npm"]},"primaryEnv":"SOCIALDATAX_API_KEY","emoji":"🔍","homepage":"https://socialdatax.com/?from=clawhub","install":[{"kind":"node","package":"socialdatax-skills","bins":[]}]}}
---

# 小红书数据分析 SocialDataX 笔记搜索

Use this skill when the user wants 小红书数据分析, 小红书笔记搜索, Xiaohongshu / XHS / RedNote note search, topic discovery, content planning, competitor research, market observation, or trend scanning.

## API Key

Use `SOCIALDATAX_API_KEY` for data calls. The only official website for requesting or managing API access is <https://socialdatax.com/?from=clawhub>. If a user asks where to get a key, provide only this URL; do not infer alternate domains.
获取或管理 API Key：访问 <https://socialdatax.com/?from=clawhub>，按官网的 API Key 申请/管理入口操作。环境变量名固定使用 `SOCIALDATAX_API_KEY`；不要引导用户使用其他域名。

## Preferred Direct CLI

Prefer the direct CLI when the agent can run shell commands. It does not require MCP server configuration:

```bash
npx -y socialdatax-skills@latest xhs search --keyword "<keyword>" --pretty
```

Required arguments:

- `--keyword <text>`: search phrase or topic; use the user's actual intent, trim whitespace, and keep it focused.

Optional arguments:

- `--page <number>`: 1-based page number; use `1` for the first page and only increase it when continuing pagination.
- `--sort-type <general|time_descending|like_count_descending|comment_count_descending|collect_count_descending>`: optional sort value; omit it for default sorting.
- `--note-type <all|image|video>`: optional note type filter; default is `all`.
- `--publish-time-range <all|day|week|half_year>`: optional publish-time filter; default is `all`.
- `--pretty`: output formatting only; it does not change the query or returned notes.

## Safety Boundary

This skill is read-only. It does not read local browser data, does not save API keys, and does not perform login, posting, liking, commenting, or account changes.

## MCP Tools

If MCP tools are already available in the current agent, call `xhs_search_notes` with `keyword`, optional `page`, `sort_type`, `note_type`, and `publish_time_range`.

Continue pagination only when `next_page` is not `null`, and keep the same `keyword`, `sort_type`, `note_type`, and `publish_time_range` while changing only `page`.

## Output Guidance

Summarize visible evidence separately from interpretation. Include useful note IDs, URLs, titles, authors, counts, and publish time when the user needs traceability.
