ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

xiaohongshu-note-fetcher

抓取并整理小红书笔记公开页面信息(标题、正文摘要、作者、发布时间、互动数据、标签、封面图等)为结构化 JSON 或 Markdown。用于“根据笔记链接提取内容”“批量收集笔记基础信息”“生成笔记摘要素材”等场景;当用户提供小红书笔记 URL、URL 列表或需要导出机器可读结果时触发。

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/2813223285/xiaohongshu-note-fetcher
Or

小红书笔记获取

极简规则

输入 TikHub API Key + 需求(关键词、页码) 即可抓取小红书搜索数据。

最小示例:

make tikhub-fetch \
  KEYWORD="女性力量" \
  TIKHUB_PAGE=2 \
  TIKHUB_TOKEN="<YOUR_TIKHUB_KEY>" \
  TIKHUB_ENDPOINT=web \
  TIKHUB_AUTH_MODE=bearer

输出文件:

  • workspace/xiaohongshu-note-fetcher-skill-data/tikhub_search_page2.json

快速开始

  1. 收集输入来源:
  • 单条链接:直接给 URL。
  • 批量链接:准备一个文本文件,每行一个 URL。
  • 若目标页面需登录态:提供 Cookie 字符串或 Cookie 文件。
  1. 运行脚本抓取(页面解析模式):
python3 scripts/fetch_xiaohongshu_notes.py \
  --url "https://www.xiaohongshu.com/explore/<note_id>" \
  --format both \
  --output result.json
  1. 批量抓取示例:
python3 scripts/fetch_xiaohongshu_notes.py \
  --url-file ./urls.txt \
  --format json \
  --output notes.json
  1. 运行 TikHub API 搜索(推荐用于关键词搜笔记):
python3 scripts/search_notes_tikhub.py \
  --token "<YOUR_TIKHUB_TOKEN>" \
  --keyword "女性主义" \
  --page 1 \
  --output search_page1.json

也可以使用 Makefile 一键调用(推荐长期使用):

make tikhub-fetch \
  KEYWORD="美食" \
  TIKHUB_TOKEN="<YOUR_TIKHUB_TOKEN>" \
  TIKHUB_ENDPOINT=web \
  TIKHUB_AUTH_MODE=bearer

若你不想每次手输 token,可把 token 放到文件(如 ./.tikhub_token):

make tikhub-fetch \
  KEYWORD="美食" \
  TIKHUB_TOKEN_FILE=./.tikhub_token \
  TIKHUB_ENDPOINT=web \
  TIKHUB_AUTH_MODE=bearer
  1. 使用其他服务商 API(通用适配):
python3 scripts/search_notes_generic.py \
  --base-url "https://your-api.example.com/search_notes" \
  --auth-mode bearer \
  --auth-header Authorization \
  --token "<YOUR_API_TOKEN>" \
  --keyword "美食推荐" \
  --page 1 \
  --param sort_type=general \
  --output generic_search.json
  1. 从 TikHub 响应生成文章列表(按点赞过滤):
python3 scripts/build_article_list_from_tikhub.py \
  --input ./tikhub_search.json \
  --min-likes 1000 \
  --rank-by hot \
  --md-output ./xhs_article_list.md \
  --csv-output ./xhs_article_list.csv \
  --json-output ./xhs_article_list.json \
  --template-output ./xhs_publish_templates.md
  1. 自动翻页抓取并合并(直接调 TikHub):
python3 scripts/build_article_list_from_tikhub.py \
  --token "<YOUR_TIKHUB_TOKEN>" \
  --keyword "美食" \
  --pages 5 \
  --sort general \
  --note-type _0 \
  --min-likes 1000 \
  --rank-by hot \
  --top 50
  1. 交互式筛选与查看(会先问你筛选方式,含默认方案):
python3 scripts/interactive_filter_view.py \
  --input ./tikhub_search.json

直接回车会采用默认方案:

  • 点赞阈值:1000
  • 排序:hot(综合热度)
  • 条数:20
  • 查看:summary
  • 同时导出 md/csv

若你不想交互,直接用默认方案:

python3 scripts/interactive_filter_view.py \
  --input ./tikhub_search.json \
  --non-interactive
  1. 导图输出(保留):
python3 scripts/generate_wow_pack.py \
  --input ./xhs_article_list.json \
  --keyword 美食 \
  --url-output ./xhs_topic_mindmap_url.txt
  1. 本机浏览器抓取(不走第三方 API,推荐):
node scripts/fetch_xiaohongshu_note_playwright.js \
  --url "https://www.xiaohongshu.com/explore/<note_id>" \
  --cookie-file ./cookie.txt \
  --output note_browser.json \
  --screenshot note_browser.png \
  --html-out note_browser.html

若首次运行提示 playwright_not_installed,先安装:

Metadata

Stars4473
Views2
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-2813223285-xiaohongshu-note-fetcher": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.