lucasygu/redbook

小红书 CLI — 搜索、分析、自动化 Xiaohongshu content. Built for AI agents.

What it solves

redbook is a command-line interface (CLI) tool designed to automate interaction with Xiaohongshu (RED), allowing users to perform market research, content analysis, and account management without needing an official API key. It simplifies the process of extracting data, analyzing viral trends, and managing engagement on the platform.

How it works

The tool extracts authentication cookies directly from the user's Chrome browser session (supporting macOS, Windows, and Linux) to authenticate requests. It uses custom TypeScript implementations of the platform's signing algorithms to communicate with both the main API and the creator API. To handle modern browser security (like Chrome 127+ App-Bound Encryption on Windows), it can launch a headless Chrome instance to retrieve cookies via the DevTools Protocol.

Who it’s for

  • Content Creators: To analyze viral hooks, extract content templates from successful posts, and manage comments efficiently.
  • Market Researchers: To perform keyword research, competitive analysis of top creators, and identify "blue ocean" content gaps.
  • KOS/KOC Managers: To generate batch account reports on posting and engagement data.
  • SMMs: To automate repetitive tasks like batch-replying to comments using specific strategies.

Highlights

  • Viral Analysis: Built-in tools to analyze viral notes and extract structural templates for content creation.
  • AI Agent Integration: Native support for AI coding agents like Claude Code and OpenClaw, allowing users to perform complex research tasks via natural language.
  • Engagement Automation: Strategic batch-replying to comments (e.g., prioritizing questions) with randomized delays to avoid bot detection.
  • Content Generation: Renders Markdown files into styled PNG image cards specifically formatted for Xiaohongshu.
  • Health Check: Detects hidden rate-limiting (throttling) on notes using a secret level field from the creator API.

Related

  • Project
  • Project
  • Project
  • Project