xhs-engagement

Scrapes engagement metrics from Xiaohongshu creator backend and writes them to a tracking database.

8.5k|1.4k|Updated Apr 24, 2024
One-click install
npx skills add https://github.com/TeamWiseFlow/wiseflow --skill xhs-engagement
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xhs-engagement
Source: https://github.com/TeamWiseFlow/wiseflow/tree/main/crews/main/skills/expert-xhs/tools/xhs-engagement
Command: npx skills add https://github.com/TeamWiseFlow/wiseflow --skill xhs-engagement

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires camoufox-cli, and includes scripts (resource) components.

What problem does it solve?

Manually checking views, comments, likes, favorites, and shares for every published Xiaohongshu (RED) note is tedious and error-prone. This Skill automates the collection of those five engagement metrics from the official creator backend and records them into a published-content tracking database for daily review and data-driven content iteration.

Core Features & Use Cases

  • Single-note metric fetch: Retrieve the five engagement columns (views, comments, likes, favorites, shares) for one note by database row ID or by title, with automatic database write-back.
  • Batch refresh: Open the creator backend note manager once, parse all notes on the first page, and update every matching row in the pub_xhs table.
  • Session health check and debugging: Verify creator backend login state before fetching, and dump screenshots, DOM, and parsed JSON for troubleshooting page structure changes.
  • Use Case: A social media operator runs a daily scheduled job that refreshes engagement numbers for all recently published Xiaohongshu notes, then feeds the data into a performance review workflow to decide which content style to replicate.

Quick Start

Ask the agent to run xhs-engagement fetch with the row ID of a published Xiaohongshu note to pull its latest engagement metrics into the tracking database.

Frequently Asked Questions about xhs-engagement

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

FAQPage Schema
How do I scrape engagement metrics from Xiaohongshu published notes?

Use the fetch command with a database row ID or note title. The tool opens the creator backend note manager via camoufox-cli, parses note cards with DOM selectors, matches by title, and returns views, comments, likes, favorites, and shares as JSON.

How to batch update Xiaohongshu note metrics in a database?

Run the fetch-all command. It opens the note manager first page once, parses all visible notes, matches them against every row in the pub_xhs table, and writes metrics through the published-track update-metrics.sh script without pagination.

Can this tool scrape competitor Xiaohongshu accounts?

No. It only works for accounts you own with creator backend access, since metrics come from the official creator platform's note management page. Competitor account data is a product limitation, not a technical one.

Why does Xiaohongshu metric fetching fail with SESSION_EXPIRED?

SESSION_EXPIRED (exit code 2) means the creator backend redirected to a login page. Re-login requires two steps: manual QR login on the consumer site via login-manager, then running xhs-publish login-verify to complete creator domain SSO.

What are the rate limits for scraping Xiaohongshu creator backend?

The recommended limit is at most one full batch refresh per account per 24 hours, with single-note fetches on demand. Exceeding this risks 403 errors or platform risk-control flags, in which case you should fall back to manual metric updates.