Use this skill when you need to call the vendored Xiaohongshu/XHS APIs from Spider_XHS for PC web data or creator-platform publishing data. This skill only wraps the APIs in xhs_pc_apis.py and xhs_creator_apis.py, including note, user, search, comment, topic, location, media upload, note publishing, and creator published-note queries.
Resources
3Install
npx skillscat add cv-cat/xhsskills/xhs-apis Install via the SkillsCat registry.
SKILL.md
XHS APIs
Overview
Use this skill to run the vendored Spider_XHS APIs for XHS PC and creator-platform workflows.
This skill only exposes the methods defined in xhs_pc_apis.py and xhs_creator_apis.py.
Quick Start
- Install Python dependencies:
pip install -r skills/xhs-apis/scripts/requirements.txt- Install Node dependencies:
Set-Location skills/xhs-apis/scripts
npm install- Inspect available methods:
python skills/xhs-apis/scripts/xhs_api_tool.py list- Call an API:
python skills/xhs-apis/scripts/xhs_api_tool.py call pc get_note_info --params "{\"url\":\"https://www.xiaohongshu.com/explore/...\",\"cookies_str\":\"a1=...; web_session=...\"}"Workflow
- Use the
pcnamespace for public-site note, user, search, comment, message, and feed APIs. - Use the
creatornamespace for creator-platform topic lookup, location lookup, media upload, note publishing, and published-note queries. - If you are unsure which method to use, run
listfirst or read api-index.md.
Parameter Rules
pcmethods mostly expectcookies_str.creatorsource methods often expect acookiesdict. The CLI accepts eithercookiesorcookies_strand converts automatically.- For creator file inputs, pass file paths in JSON. The CLI reads those files into bytes before calling the vendored API.
- For
creator.post_note, passnoteInfo.media_typeasimageorvideo, then provide eitherimagesorvideo.
Runtime Notes
- The runtime shipped with this skill is a trimmed vendor copy that keeps only the code needed by
xhs_pc_apis.pyandxhs_creator_apis.py. - The CLI changes into its vendored runtime directory before import so the bundled JS signers can resolve their relative
static/files. - If
jsdomorcrypto-jserrors appear, rerunnpm installinsideskills/xhs-apis/scripts.
References
- Full method inventory and payload notes: api-index.md