xiaohongshu-scraper

Scrape Xiaohongshu search results and post details into JSONL and CSV datasets.

1|1|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/yuyuxinli/moodcoco --skill xiaohongshu-scraper
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xiaohongshu-scraper
Source: https://github.com/yuyuxinli/moodcoco/tree/main/.claude/skills/xiaohongshu-scraper
Command: npx skills add https://github.com/yuyuxinli/moodcoco --skill xiaohongshu-scraper

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

It automates the manual, error-prone process of collecting Xiaohongshu search results and post details from the browser into structured data for analysis, saving time for competitor research and content planning.

Core Features & Use Cases

  • Browser-based extraction: Uses a Chrome extension context and injected JavaScript to read Xiaohongshu's SSR state and DOM to reliably collect noteIds, titles, engagement counts, tags, images and top comments.
  • Scripted workflow with fallbacks: Provides modular scripts for setting filters, extracting search results, opening posts, extracting post details, closing overlays, and a Python post-processing step to merge JSONL into CSV and per-post Markdown files; includes retry and skip strategies for common UI race conditions.
  • Outputs and use cases: Produces search_results.jsonl and post_details.jsonl, a combined CSV, and per-post .md files for competitor analysis, content inspiration, trend monitoring, and dataset creation for social research.

Quick Start

Open Chrome while logged into Xiaohongshu and run the provided scripts in sequence to collect search results and post details into JSONL, then run the Python processor to generate CSV and Markdown outputs.

Frequently Asked Questions about xiaohongshu-scraper

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract Xiaohongshu search results and post details into a structured dataset?

To extract Xiaohongshu data, use a Chrome browser logged into the platform and run injected JavaScript scripts to collect noteIds, titles, engagement counts, and comments into JSONL files. A Python processor then merges and exports the data into CSV and Markdown formats for analysis.

Do I need a logged-in Chrome session to scrape Xiaohongshu post data?

Yes, scraping Xiaohongshu requires a logged-in Chrome session. The extraction relies on a cooperating Chrome tool to inject JavaScript that reads the platform's SSR state and DOM to reliably capture post details and engagement metrics.

What data formats are outputted when scraping Xiaohongshu posts for competitor research?

Scraping Xiaohongshu outputs raw data into JSONL files, which a Python post-processing step converts into a combined CSV dataset and per-post Markdown files. These formats support competitor analysis, content inspiration, and trend monitoring workflows.

How does the Xiaohongshu scraper handle UI race conditions during bulk data extraction?

The Xiaohongshu scraper handles UI race conditions using a scripted workflow with modular retry and skip strategies. These fallbacks manage common browser UI delays when opening posts, extracting details, and closing overlays during bulk extraction.

Can I use this approach to extract top comments and images from Xiaohongshu notes?

Yes, the extraction scripts are designed to collect top comments and images alongside titles and engagement counts. This data is extracted from the DOM and SSR state, then processed into structured JSONL and CSV outputs.

What is the best way to automate Xiaohongshu data extraction for content inspiration?

The best way to automate Xiaohongshu data extraction is running modular scripts sequentially via a Chrome extension to scrape search results and post details. Follow up with the included Python processor to generate CSV and Markdown files for content research.