feat(xiaohongshu): add 4 creator analytics commands (creator-profile, creator-stats, creator-notes, creator-note-detail)#49
Conversation
Add creator backend support for Xiaohongshu (小红书), enabling creators to access their analytics data from the command line. New commands: - creator-profile: account info (followers, likes, creator level) - creator-stats: 7-day/30-day overview (views, likes, collects, comments, shares, new followers) with daily trend data - creator-notes: note list with per-note metrics from note manager - creator-note-detail: single note analytics breakdown (organic vs promoted vs video traffic) API discovery: - /api/galaxy/creator/home/personal_info (cookie auth, 200 OK) - /api/galaxy/creator/data/note_detail_new (cookie auth, 200 OK) - /api/galaxy/creator/data/note_detail?note_id=xxx (cookie auth, 200 OK) - Note manager DOM extraction for note list (bypasses v2 signature) All endpoints verified working with real creator account. Screenshots (redacted) included in docs/screenshots/. Requires: Chrome logged into creator.xiaohongshu.com
Co-authored-by: stone16 <stone2paul@gmail.com>
4c05337 to
5f5033b
Compare
Co-authored-by: stone16 <stone2paul@gmail.com>
|
Thanks for the contribution! I pushed a follow-up fix directly onto this branch and kept you credited via Co-authored-by.\n\nWhat I fixed:\n- preserved \ in the built manifest/package output\n- added \ to \ so it composes cleanly with \n- added a targeted \ workflow so we do not need to run every site's tests for every change\n\nReally appreciate the creator analytics work here. |
|
Thanks for the contribution! I pushed a follow-up fix directly onto this branch and kept you credited via Co-authored-by. What I fixed:
Really appreciate the creator analytics work here. |
|
Thanks for the contribution! This adds a really useful creator-side Xiaohongshu surface to opencli. I pushed a small follow-up fix to the note-manager DOM parser so publish timestamps are excluded before extracting per-note metrics, and re-ran
==> Typecheck
==> Targeted verify No site-specific vitest files found for "xiaohongshu". Skipping full vitest run.. Everything looks good now. |
jackwener
left a comment
There was a problem hiding this comment.
Reviewed the creator analytics commands and followed up with a fix for the note-manager DOM parser so publish timestamps no longer get counted as note metrics. Local verification passed: npm run typecheck and npm run test:site -- xiaohongshu.
feat(xiaohongshu): Add 4 Creator Analytics Commands
Summary
Adds creator backend support for Xiaohongshu (小红书), enabling creators to access their analytics data from the CLI. This covers the
creator.xiaohongshu.comdomain — a separate surface from the existing public-facingxiaohongshu.comcommands.New Commands
creator-profilecreator-statscreator-notescreator-note-detailAPI Discovery
Discovered and verified the following internal APIs:
/api/galaxy/creator/home/personal_info/api/galaxy/creator/data/note_detail_new/api/galaxy/creator/data/note_detail?note_id=xxx/api/galaxy/v2/creator/datacenter/account/base/api/galaxy/v2/creator/note/user/postedFor note list, the v2 API requires
x-ssignature. I used DOM extraction from the note manager page as a reliable fallback — similar to how the existingxiaohongshu/searchcommand works.Verified Working
All commands tested against a real creator account.
API Response Examples
creator-stats (note_detail_new)
{ "seven": { "view_count": 517, "view_time_avg": 15966, "home_view_count": 22, "like_count": 17, "collect_count": 17, "comment_count": 8, "share_count": 9, "rise_fans_count": 5, "view_list": [{"date": 1773072000000, "count": 344}, ...] } }creator-note-detail (per-note breakdown)
{ "total_read": 0, "total_promo_read": 0, "total_engage": 0, "total_like": 0, "total_fav": 0, "total_cmt": 0, "total_share": 0, "normal_read": 0, "normal_engage": 0, "normal_like": 0, "video_read": 0, "video_engage": 0, "video_like": 0 }creator-profile (personal_info)
{ "name": "[redacted]", "follow_count": 68, "fans_count": 49, "faved_count": 1043, "grow_info": {"level": 1, "fans_count": 49, "max_fans_count": 500} }Prerequisites
creator.xiaohongshu.comTypeScript
npx tsc --noEmitpasses with zero errorsxiaohongshu/search.ts,xiaohongshu/user.ts)