Agent skill

Xiaohongshu Hub

by OpenMinis in OpenMinis/MinisSkills

Skill for reading and writing Xiaohongshu (XHS) data using Python + UV.

MITAuto-check passedProductivity & Automation

Install Xiaohongshu Hub

skills CLI
$ npx skills add OpenMinis/MinisSkills --skill xiaohongshu-hub -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install OpenMinis/MinisSkills xiaohongshu-hub --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/OpenMinis/MinisSkills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/xiaohongshu-hub .claude/skills/xiaohongshu-hub && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
xiaohongshu-hub
GitHub stars
446
Token cost
~2.7k tokens
SKILL.md length
703 words
Files
8 (incl. scripts)
Skills in repo
49
Repo updated
First seen
Licence
MIT

At a glance

Skill for reading and writing Xiaohongshu (XHS) data using Python + UV.

  • Works in 3 steps: Use browser_use navigate to open… → Use browser_use get_cookies to retrieve… → Load the env file before use
  • Mentions Xiaohongshu
  • SKILL.md covers File Structure, Authentication Methods, Quick Start and API Method Quick Reference, plus 3 more sections
  • Runs Python scripts from its folder; calls uv; reaches xiaohongshu.com

What it does

Xiaohongshu Hub is an agent skill from OpenMinis/MinisSkills. Skill for reading and writing Xiaohongshu (XHS) data using Python + UV. It depends only on httpx + pycryptodome, automatically retrieves cookies via browseruse getcookies to complete authentication, and requires no manual copying. It supports searching notes, users, and topics; reading note details and comments; recommendation feeds; trending lists; social actions (follow/favorite); interactions (like/comment/reply); notification queries; creator note management; and more. This skill must be triggered when the…

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including scripts (for example `scripts/__init__.py`, `scripts/client.py` and `scripts/constants.py`).

It sits in Productivity & Automation, covering Browser automation, Web scraping and Authentication. It works with Xiaohongshu and Python. The repository describes itself as: Skills collection for Minis. The licence is MIT.

When your agent uses it

  • Mentions Xiaohongshu
  • Scraping Xiaohongshu
  • Searching Xiaohongshu notes
  • Xiaohongshu comments

Example prompts

  • “Xiaohongshu,”
  • “scraping Xiaohongshu,”
  • “searching Xiaohongshu notes,”
  • “/xiaohongshu-hub”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Use browser_use navigate to open https://www.xiaohongshu.com and confirm that you are logged in.
  2. Use browser_use get_cookies to retrieve a1, web_session, and webId separately.
  3. Load the env file before use

What it can do on your machine

Read from SKILL.md and the folder at commit ae8c5db. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 6 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • xiaohongshu.com

    Also links to:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Xiaohongshu Hub loads about 2.7k tokens when it runs. Until then it costs about 202 tokens; SKILL.md has 703 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~202
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from OpenMinis/MinisSkills at commit ae8c5db, republished under its MIT licence (© OpenMinis). 703 words, ~2,720 tokens.

Download SKILL.mdSave it as .claude/skills/xiaohongshu-hub/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
xiaohongshu-hub
description
Skill for reading and writing Xiaohongshu (XHS) data using Python + UV. It depends only on httpx + pycryptodome, automatically retrieves cookies via `browser_use get_cookies` to complete authentication, and requires no manual copying. It supports searching notes, users, and topics; reading note details and comments; recommendation feeds; trending lists; social actions (follow/favorite); interactions (like/comment/reply); notification queries; creator note management; and more. This skill must be triggered when the user mentions "Xiaohongshu," "XHS," "scraping Xiaohongshu," "searching Xiaohongshu notes," "Xiaohongshu comments," "xiaohongshu-hub," "reading Xiaohongshu data," "Xiaohongshu Cookie," or any scenario that requires programmatically reading or writing Xiaohongshu content.

xiaohongshu-hub

Modified from: jackwener/xiaohongshu-cli (Apache-2.0)

This skill simplifies and modifies the original repository as follows:

  • Removes the browser-cookie3 / click / rich / PyYAML / qrcode dependencies
  • Changes Cookie authentication to pass a dict directly or read from environment variables, without automatic browser extraction
  • Removes the CLI layer (commands/) and QR login module (qr_login.py)
  • Keeps the complete reverse-engineered signing algorithm in signing.py, implemented with the standard library only and no third-party dependencies
  • Keeps AES-128-CBC signing in creator_signing.py (depends on pycryptodome)
  • In the Minis environment, cookies are automatically retrieved through browser_use get_cookies

File Structure

/var/minis/skills/xiaohongshu-hub/
├── SKILL.md
├── pyproject.toml          # UV project configuration (httpx + pycryptodome only)
└── scripts/
    ├── __init__.py
    ├── constants.py        # Constants (Host, UA, SDK version, etc.)
    ├── exceptions.py       # Structured exceptions (6 error types)
    ├── signing.py          # Main API signing (x-s / x-s-common / x-t), standard library only
    ├── creator_signing.py  # Creator API signing (AES-128-CBC)
    └── client.py           # XhsClient core class (all API methods)

Authentication Methods

The Xiaohongshu Web API uses three key cookies:

CookieDescription
a1User identity identifier and core signing algorithm parameter (required)
web_sessionLogin session (required)
webIdDevice ID (recommended)
Method 1: Automatically Retrieve with browser_use (Preferred in the Minis Environment)

In Minis, you can use the browser_use tool to navigate to Xiaohongshu, then use get_cookies to read the cookies automatically. Raw Cookie values will not appear in the conversation. They are passed securely through an offload env file.

Steps:

  1. Use browser_use navigate to open https://www.xiaohongshu.com and confirm that you are logged in.
  2. Use browser_use get_cookies to retrieve a1, web_session, and webId separately.
    • The tool returns an offload env file path, such as /var/minis/offloads/env_cookies_xxx.sh.
    • Raw Cookie values do not appear in the conversation context.
  3. Load the env file before use:
bash
. /var/minis/offloads/env_cookies_xxx.sh
# The file exports variables such as COOKIE_A1 / COOKIE_WEB_SESSION / COOKIE_WEBID
export XHS_A1="$COOKIE_A1"
export XHS_WEB_SESSION="$COOKIE_WEB_SESSION"
export XHS_WEBID="$COOKIE_WEBID"

Note: get_cookies only applies to the current page's domain. Navigate to https://www.xiaohongshu.com before calling it.

Method 2: Manually Retrieve Cookies from Browser DevTools
  1. Log in to Xiaohongshu and open DevTools -> Application -> Cookies -> https://www.xiaohongshu.com.
  2. Find the values for a1, web_session, and webId.
  3. Save them to Minis environment variables (Settings -> Environments): XHS_A1 / XHS_WEB_SESSION / XHS_WEBID.
Ways to Pass Cookies (Three Methods, Highest to Lowest Priority)
  1. Environment variables: XHS_A1 + XHS_WEB_SESSION + XHS_WEBID (recommended)
  2. Pass directly in code: XhsClient({"a1": ..., "web_session": ..., "webId": ...})
  3. Script arguments: Pass through arguments such as -a1 / --web-session

Quick Start

Set Up the Environment
bash
cd /var/minis/skills/xiaohongshu-hub
uv sync
python
import os, json, sys
sys.path.insert(0, "/var/minis/skills/xiaohongshu-hub")
from scripts.client import XhsClient

# Method 1: Build from environment variables (recommended)
client = XhsClient.from_env()

# Method 2: Pass a Cookie dict directly
client = XhsClient({
    "a1":          os.environ["XHS_A1"],
    "web_session": os.environ["XHS_WEB_SESSION"],
    "webId":       os.environ["XHS_WEBID"],
})

with client:
    # Current user information
    me = client.get_self_info()
    print("User:", me.get("nickname"))

    # Search notes
    results = client.search_notes("Food", page=1)
    for item in results.get("items", [])[:5]:
        note = item.get("note_card", {})
        print(f"  - {note.get('display_title', '')}")

    # Recommendation feed
    feed = client.get_home_feed()
    print(f"Recommendation feed: {len(feed.get('items', []))} items")

    # Trending notes (travel)
    hot = client.get_hot_feed("homefeed.travel_v3")
    print(f"Trending travel: {len(hot.get('items', []))} items")
Call Through a Script (Shell Environment)
bash
# Search notes and output JSON
cd /var/minis/skills/xiaohongshu-hub
uv run python -c "
import os, json, sys
sys.path.insert(0, '.')
from scripts.client import XhsClient
with XhsClient.from_env() as c:
    r = c.search_notes('Travel', page=1)
    print(json.dumps(r, ensure_ascii=False, indent=2))
"

# Get current user information
uv run python -c "
import os, json, sys
sys.path.insert(0, '.')
from scripts.client import XhsClient
with XhsClient.from_env() as c:
    print(json.dumps(c.get_self_info(), ensure_ascii=False, indent=2))
"

API Method Quick Reference

User
MethodDescription
get_self_info()Get information about the currently logged-in user
get_user_info(user_id)Get profile information for a specified user
get_user_notes(user_id, cursor="")Get a list of notes posted by a user
MethodDescription
search_notes(keyword, page=1, sort="general", note_type=0)Search notes
search_users(keyword, page=1)Search users
search_topics(keyword)Search topics/tags

sort options: "general" / "popularity_descending" / "time_descending" note_type options: 0 = all / 1 = video / 2 = image and text

Notes
MethodDescription
get_note_by_id(note_id, xsec_token="")Get note details
get_comments(note_id, cursor="", xsec_token="")Get comments (single page)
get_all_comments(note_id, xsec_token="", max_pages=20)Automatically page through and get all comments
get_sub_comments(note_id, comment_id, cursor="", xsec_token="")Get comment replies
Show full SKILL.md (276 more words)Show less
Feed / Discover
MethodDescription
get_home_feed(category="homefeed_recommend")Recommendation feed
get_hot_feed(category="homefeed.food_v3")Trending notes (by category)

Trending categories: fashion_v3 / food_v3 / cosmetics_v3 / movie_and_tv_v3 / career_v3 / love_v3 / household_product_v3 / gaming_v3 / travel_v3 / fitness_v3

Social
MethodDescription
follow_user(user_id)Follow a user
unfollow_user(user_id)Unfollow
get_user_favorites(user_id, cursor="")Get a user's favorites
Interaction
MethodDescription
like_note(note_id, xsec_token="")Like
unlike_note(note_id, xsec_token="")Unlike
collect_note(note_id, xsec_token="")Favorite
uncollect_note(note_id, xsec_token="")Unfavorite
post_comment(note_id, content, xsec_token="")Post a comment
reply_comment(note_id, comment_id, content, xsec_token="")Reply to a comment
delete_comment(note_id, comment_id)Delete your own comment
Notifications
MethodDescription
get_unread_count()Number of unread notifications
get_notifications_mentions(cursor="")Comments / @ notifications
get_notifications_likes(cursor="")Like / favorite notifications
get_notifications_connections(cursor="")New follower notifications
Creator
MethodDescription
get_my_notes(page=0)Get a list of notes you posted
delete_note(note_id)Delete a note (experimental)

Error Handling

python
from scripts.exceptions import (
    NeedVerifyError,    # CAPTCHA triggered (HTTP 461/471)
    SessionExpiredError, # Cookie expired (code -100)
    IpBlockedError,     # IP blocked (code 300012)
    SignatureError,     # Signing failed (code 300015)
    XhsApiError,        # Other API errors (base class)
)

try:
    result = client.search_notes("Food")
except NeedVerifyError:
    print("A CAPTCHA was triggered. Complete verification in the browser and try again.")
except SessionExpiredError:
    print("Cookie has expired. Retrieve it again.")
except IpBlockedError:
    print("IP is blocked. Switch networks.")
except XhsApiError as e:
    print(f"API error: {e} (code={e.code})")

Anti-Risk-Control Mechanisms

This skill inherits the complete anti-risk-control implementation from the original repository:

  • Gaussian jitter: Uses a truncated Gaussian distribution for request intervals (not fixed intervals) to simulate natural browsing rhythms
  • Random long pauses: About 5% of requests wait an additional 2 to 5 seconds to simulate reading behavior
  • Exponential backoff: Automatically retries HTTP 429/5xx (up to 3 times)
  • CAPTCHA cooldown: After a CAPTCHA is triggered, automatically waits 5 -> 10 -> 20 -> 30 seconds and permanently doubles the request interval
  • Browser fingerprint consistency: macOS Chrome UA, with session-level GPU/resolution/CPU kept fixed
  • Complete signing: x-s / x-s-common / x-t signing (reverse-engineered from the web client)

Notes

  • Cookies are usually valid for several days to several weeks. After they expire, retrieve them again through browser_use get_cookies.
  • Use a dedicated account to avoid risk-control flags on your main account.
  • Write operations (comments, likes, etc.) carry a higher risk-control risk than read operations. Use them with discretion.
  • get_all_comments pages through up to 20 pages by default. You can adjust this with max_pages.

© OpenMinis, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts) in xiaohongshu-hub of OpenMinis/MinisSkills.

  • SKILL.md
  • pyproject.toml
  • scripts/__init__.py
  • scripts/client.py
  • scripts/constants.py
  • scripts/creator_signing.py
  • scripts/exceptions.py
  • scripts/signing.py

Open the folder on GitHubat commit ae8c5db

Compare with similar skills

Xiaohongshu Hub next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Xiaohongshu Hub compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Xiaohongshu Hub this skillOpenMinis/MinisSkills446—~2.7kAutomated safety check: PassMIT
Skyvern Browser AutomationSkyvern-AI/skyvern23k—~1.9kAutomated safety check: PassAGPL-3.0
Tiered Web Browsing and Scrapingcode-yeongyu/oh-my-openagent70k—~2.7kAutomated safety check: WarnCustom licence
Image ScraperaAAaqwq/AGI-Super-Team105—~914Automated safety check: PassMIT
Firecrawl Interact Integrationfirecrawl/firecrawl190k1 repos~731Automated safety check: PassISC
bb-browser Site Commands for OpenClawepiral/bb-browser6.2k—~1kAutomated safety check: PassMIT

Similar skills

  • Skyvern Browser Automation

    Skyvern-AI/skyvern

    Automates websites with Skyvern's AI browser agent to fill forms, extract data, download files, log in and run multi-step workflows through SDKs, REST, MCP or a CLI.

    23k GitHub stars~1.9k tokensUpdated yesterday
    Productivity & AutomationAuto-check passed
  • Tiered Web Browsing and Scraping

    code-yeongyu/oh-my-openagent

    Routes a web request through the cheapest tier that can finish it, from headless extraction with WAF bypass up to a real stealth or signed-in browser, with screenshots as proof.

    70k GitHub stars~2.7k tokensUpdated today
    Productivity & AutomationAuto-check: warnings
  • Image Scraper

    aAAaqwq/AGI-Super-Team

    Scrape and download all images from a given URL. An agent skill from aAAaqwq/AGI-Super-Team.

    105 GitHub stars~914 tokensUpdated 3 days ago
    Productivity & AutomationAuto-check passed
  • Guides adding Firecrawl's /interact endpoint to product code for pages that need clicks, forms, pagination or logged-in flows beyond plain scraping.

    190k GitHub starsUsed in 1 repo~731 tokens
    Data & AnalyticsAuto-check passed
  • Runs structured data commands against sites such as Twitter, Reddit, GitHub, YouTube and Zhihu through OpenClaw's browser, reusing your existing login state.

    6.2k GitHub stars~1k tokensUpdated 4 mo ago
    Productivity & AutomationAuto-check passed
  • Xhs CLI

    jackwener/xhs-cli

    Headless-browser-based CLI skill for Xiaohongshu (小红书, RedNote, XHS) to search notes, read posts, browse profiles, like, favorite, comment, and publish from the terminal

    666 GitHub stars~1.1k tokensUpdated 2 days ago
    Productivity & AutomationAuto-check: warnings

More from OpenMinis/MinisSkills

All 49 skills in this repo
  • Android UI Automation

    OpenMinis/MinisSkills

    Automate Android apps that have no public API or web version by driving the UI layer through the Accessibility Service.

    446 GitHub stars~1.6k tokensUpdated 3 days ago
    Auto-check passed
  • Codex On Ish

    OpenMinis/MinisSkills

    Install and run OpenAI Codex CLI inside the Minis/iSH Alpine sandbox on iOS, where rustls TLS and async sockets are broken.

    446 GitHub stars~1k tokensUpdated 3 days ago
    Auto-check passed
  • Evidence Chain Builder

    OpenMinis/MinisSkills

    Score a claim against the evidence behind it. An agent skill from OpenMinis/MinisSkills.

    446 GitHub stars~2.4k tokensUpdated 3 days ago
    Auto-check passed
  • Hyperframes CLI

    OpenMinis/MinisSkills

    HyperFrames CLI and Minis rendering. An agent skill from OpenMinis/MinisSkills.

    446 GitHub stars~3.5k tokensUpdated 3 days ago
    Auto-check passed
  • Whenpeak

    OpenMinis/MinisSkills

    Predict when a person's brain works best from their sleep, using the WhenPeak performance-intelligence API, and turn it into concrete scheduling advice.

    446 GitHub stars~2.3k tokensUpdated 3 days ago
    Auto-check passed
  • Openstreetmap Marker

    OpenMinis/MinisSkills

    Generate a mobile-first, immersive, Amap(Gaode)-style custom landmark marker HTML map for travel itinerary planning, place showcasing, location sharing, etc.

    446 GitHub stars~1.9k tokensUpdated 3 days ago
    Auto-check passed

Questions about Xiaohongshu Hub

What does Xiaohongshu Hub do?

Skill for reading and writing Xiaohongshu (XHS) data using Python + UV. Xiaohongshu Hub is an agent skill from OpenMinis/MinisSkills. Skill for reading and writing Xiaohongshu (XHS) data using Python + UV.

When should I use Xiaohongshu Hub?

Xiaohongshu Hub fits situations like: mentions Xiaohongshu; scraping Xiaohongshu; searching Xiaohongshu notes; xiaohongshu comments.

How do I install Xiaohongshu Hub in Claude Code?

Run `npx skills add OpenMinis/MinisSkills --skill xiaohongshu-hub -a claude-code`. Or copy the skill folder (xiaohongshu-hub in OpenMinis/MinisSkills) into .claude/skills/xiaohongshu-hub in your project. Claude Code loads it when a task matches its description.

How do I install Xiaohongshu Hub in Codex?

Run `npx skills add OpenMinis/MinisSkills --skill xiaohongshu-hub -a codex`. Or copy the skill folder (xiaohongshu-hub in OpenMinis/MinisSkills) into .agents/skills/xiaohongshu-hub in your project. Codex loads it when a task matches its description.

Can I use Xiaohongshu Hub in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add OpenMinis/MinisSkills --skill xiaohongshu-hub -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/xiaohongshu-hub, .gemini/skills/xiaohongshu-hub, .github/skills/xiaohongshu-hub and .opencode/skills/xiaohongshu-hub in your project.

What does Xiaohongshu Hub need to run?

Going by SKILL.md and its folder, Xiaohongshu Hub needs Python for the scripts in its folder and the command-line tools its instructions call (uv). Our summary lists: Python 3.

Does Xiaohongshu Hub access the network?

SKILL.md names 2 domains. In commands or code: xiaohongshu.com; the agent is likely to contact it when it follows the instructions. As links in the text: github.com. This is read from the text; nothing was executed.

Is Xiaohongshu Hub safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Xiaohongshu Hub use?

Xiaohongshu Hub is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Xiaohongshu Hub use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Xiaohongshu Hub?

Skills that share tags, products or a category with Xiaohongshu Hub: Skyvern Browser Automation (Skyvern-AI/skyvern, 23k stars), Tiered Web Browsing and Scraping (code-yeongyu/oh-my-openagent, 70k stars), Image Scraper (aAAaqwq/AGI-Super-Team, 105 stars) and Firecrawl Interact Integration (firecrawl/firecrawl, 190k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Xiaohongshu Hub?

OpenMinis (a GitHub organization) maintains it in OpenMinis/MinisSkills, which has 446 GitHub stars. The repository holds 49 skills in this directory. The repository was last updated on October 7, 2026.

Source: OpenMinis/MinisSkills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.