How cv-cat/spider_xhs works
Spider_XHS is a Python API toolkit for collecting Xiaohongshu data and managing Creator, live/messaging, Pugongying, and Qianfan operations. The main workflow starts with an operator or agent invoking the PC collection entry point, which uses authenticated PC APIs to retrieve platform data; data can then be processed externally and submitted through Creator APIs. Separate platform clients cover other documented capabilities. The source index and excerpts support the authentication, signing, and transport layers; some platform API details are documented only in the README, so those links are cited there.
Main entry points: xhs_pc_apis.py PC Data API · xhs_creator_apis.py Creator API · xhs_pc/auth.py PC Auth State · xhs_creator/auth.py Creator Auth State
Components 20
PC Collection
- Collection Runner
spider/spider.py - PC Data API
apis/xhs_pc_apis.py - Data Utilities
xhs_utils/data_util.py
Login and Identity
- PC Login API
apis/xhs_pc_login_apis.py - Creator Login API
apis/xhs_creator_login_apis.py - Unified Auth
xhs_utils/xhs_auth.py - PC Auth State
xhs_utils/xhs_pc/auth.py - Creator Auth State
xhs_utils/xhs_creator/auth.py
Creator Publishing
- Creator API
apis/xhs_creator_apis.py
Platform Services
- Live and Messaging
apis/xhs_live.py - Pugongying API
apis/xhs_pugongying_apis.py - Qianfan API
apis/xhs_qianfan_apis.py
Signing and Transport
- PC Signing State
xhs_utils/xhs_pc/state.py - PC Request Signing
xhs_utils/xhs_pc/params.py - Creator Signing State
xhs_utils/xhs_creator/state.py - Creator Request Signing
xhs_utils/xhs_creator/params.py - Browser HTTP Transport
xhs_utils/xhs_core/http.py
Other components
- Operator / Agent
- Xiaohongshu Services
- External AI Agent
Connections 26
- Operator / Agent → Collection Runner: runs
README.md - Collection Runner → PC Data API: calls
spider/spider.py - Collection Runner → Data Utilities: uses
spider/spider.py - PC Data API → PC Auth State: uses
apis/xhs_pc_apis.py - PC Data API → PC Request Signing: signs requests
apis/xhs_pc_apis.py - PC Data API → Browser HTTP Transport: sends requests
- PC Data API → Xiaohongshu Services: fetches data
README.md - PC Login API → PC Auth State: initializes
apis/xhs_pc_login_apis.py - Creator Login API → Creator Auth State: initializes
apis/xhs_creator_login_apis.py - Unified Auth → PC Auth State: creates view
xhs_utils/xhs_auth.py - Unified Auth → Creator Auth State: creates lazily
xhs_utils/xhs_auth.py - PC Auth State → PC Signing State: owns state
xhs_utils/xhs_pc/auth.py - PC Auth State → PC Login API: uses login
xhs_utils/xhs_pc/auth.py - Creator Auth State → Creator Signing State: owns state
xhs_utils/xhs_creator/auth.py - Creator Auth State → Creator Login API: uses login
xhs_utils/xhs_creator/auth.py - Creator API → Creator Auth State: uses
apis/xhs_creator_apis.py - Creator API → Creator Request Signing: signs requests
apis/xhs_creator_apis.py - Creator API → Browser HTTP Transport: sends requests
apis/xhs_creator_apis.py - Creator API → Xiaohongshu Services: publishes content
README.md - Live and Messaging → Xiaohongshu Services: handles live and messages
README.md - Pugongying API → Xiaohongshu Services: queries KOL data
README.md - Qianfan API → Xiaohongshu Services: queries distributor data
README.md - PC Signing State → PC Request Signing: provides signing state
xhs_utils/xhs_pc/state.py - Creator Signing State → Creator Request Signing: provides signing state
xhs_utils/xhs_creator/state.py - External AI Agent → PC Data API: requests collection
README.md - External AI Agent → Creator API: requests publishing
README.md