Install
openclaw skills install xiaohongshu-agent📕 小红书 (Xiaohongshu/RED) Skill - AI Agent 控制小红书,发布笔记、搜索内容、管理评论
openclaw skills install xiaohongshu-agent让 AI Agent 控制小红书 (Xiaohongshu/RED)!支持发布笔记、搜索内容、获取用户信息、管理评论等。
使用前请仔细阅读 / Please read carefully before use:
🔴 高风险操作 / High Risk Operation
🔴 使用风险 / Usage Risks
🔴 免责声明 / Disclaimer
# 通过 OpenClaw 安装
openclaw skill install xiaohongshu
# 或手动安装
cp -r xiaohongshu ~/.openclaw/workspace/skills/
# 安装依赖
pip3 install xhs click --break-system-packages
方法 1: 环境变量
export XHS_COOKIE="your_xiaohongshu_cookie"
方法 2: 配置文件
创建 ~/.openclaw/workspace/xiaohongshu-cookies.md:
cookie="your_cookie_here"
获取 Cookie 方法:
Cookie 请求头的值搜索笔记:
xiaohongshu-wrapper.sh note search --keyword "Python 编程" --limit 10
获取笔记详情:
xiaohongshu-wrapper.sh note info --note-id "xxx" --xsec-token "xxx"
发布笔记:
xiaohongshu-wrapper.sh note publish \
--title "我的学习笔记" \
--content "今天学习了 Python..." \
--image-paths /path/to/image.jpg \
--topics "学习" "Python"
删除笔记:
xiaohongshu-wrapper.sh note delete --note-id "xxx"
获取当前用户:
xiaohongshu-wrapper.sh user current
获取用户信息:
xiaohongshu-wrapper.sh user info --user-id "xxx"
获取用户笔记:
xiaohongshu-wrapper.sh user notes --user-id "xxx" --limit 10
获取评论列表:
xiaohongshu-wrapper.sh comment list --note-id "xxx" --xsec-token "xxx" --limit 20
发布评论:
xiaohongshu-wrapper.sh comment post --note-id "xxx" --content "写得真好!"
获取首页推荐:
xiaohongshu-wrapper.sh feed
显示版本:
xiaohongshu-wrapper.sh version
xiaohongshu-wrapper.sh note search --keyword "Python" --json-output
#!/usr/bin/env python3
import subprocess
import time
for keyword in ["Python", "机器学习", "数据分析"]:
subprocess.run(f"xiaohongshu-wrapper.sh note search --keyword '{keyword}'", shell=True)
time.sleep(3) # 避免风控
安装所有依赖:
pip3 install xhs click --break-system-packages
| 功能 / Feature | 状态 / Status |
|---|---|
| 搜索笔记 / Search Notes | ✅ |
| 获取笔记详情 / Get Note Info | ✅ |
| 发布笔记 / Publish Note | ✅ |
| 删除笔记 / Delete Note | ✅ |
| 获取用户信息 / Get User Info | ✅ |
| 获取用户笔记 / Get User Notes | ✅ |
| 获取评论 / Get Comments | ✅ |
| 发布评论 / Post Comment | ✅ |
| 首页推荐 / Home Feed | ✅ |
| 图片上传 / Image Upload | ⚠️ 需额外配置 |
MIT License
仅供学习和研究使用 / For learning and research only
维护者 / Maintainer: 小爪 🐾
最后更新 / Last Updated: 2026-03-13