📝 Overview
Enter a Kuaishou work link to get first-level comment data, 20 per page, supporting cursor-based pagination. Display all comments on the current page and AI summary analysis in the conversation, while generating an interactive HTML report containing the current page data and summary.
✨ Features
| Feature Module | Capability Description | Core Value |
|---|---|---|
| Comment Retrieval | Paste a work link to get comments | Fetch work comment section data in real time |
| Paginated Browsing | 20 per page, cursor-based pagination | Browse large numbers of comments page by page |
| AI Summary | Four-dimensional sentiment analysis (positive/negative/demand/competitor) | Quickly understand the full picture of comment public opinion |
| Pinned Marking | Special marking for pinned comments | Identify important comments at a glance |
| HTML Report | Dark theme interactive report | Save/share analysis results offline |
| Merged Report | Multi-page merge, auto-collapse beyond 3 pages | Export all comment analysis at once |
🔑 Authentication
Go to Red Fox Hub to get an API Key, and configure it in the following ways:
# 方式一:配置文件(如 OpenClaw 的 ~/.openclaw/openclaw.json)
{ "env": { "REDFOX_API_KEY": "ak_xxxx..." } }
# 方式二:终端环境变量
export REDFOX_API_KEY="ak_xxxx..."
🔄 Workflow
Step 1: Understand user intent, extract opusId
⚠️ Core rule: The user provides a work link, and the Agent extracts the opusId from the link.
- The user provides a work link (e.g.,
https://www.kuaishou.com/short-video/3x4ibfzs5e68yxu), and the Agent extracts the opusId from the link - The user may also directly provide an opusId (e.g.,
3x4ibfzs5e68yxu), in which case use it directly - If the user does not provide a work link, proactively ask: "Please provide a Kuaishou work link"
- If the user queried data for a certain work in the previous round of conversation, and the current input is ambiguous (such as "next page" or "comment analysis"), use the opusId from the previous round
Step 2: Call the comment retrieval script (automatically generates HTML)
⚠️ Each call requests only one page of data (one API request); do not initiate multiple calls to fetch multiple pages without authorization.
The script automatically generates an HTML report on each call(contains placeholders, analysis data not yet filled in). Terminal display and HTML are based onthe same API call, ensuring data consistency.
python3 ~/.agents/skills/kuaishou-comment/scripts/kuaishou_comment_search.py "<opusId>" [--cursor <cursor>] [--page <page>]
Parameter description:
| Parameter | Description | Default Value |
|---|---|---|
opusId |
Kuaishou work opusId (required) | — |
--cursor |
Cursor; pass an empty string for the first page, and pass the nextCursor returned by the previous page for subsequent pages | "" |
--page |
Current page number (only used for the HTML file name and output marker) | 1 |
--output-dir |
HTML output directory | ~/Downloads/QoderReports |
For the JSON fields returned by the script, see the comment field table below.
Note: The HTML report currently contains only the raw comment data; the analysis placeholders will be filled in after user confirmation.
Step 3: Display comment data + AI summary in the conversation
⚠️ Each operation calls the API only once to fetch one page of data.
A1. Inform the query scope
📊 Work「{opusId}」retrieved a total of Ncomments (page {page}); the detailed data is as follows:
A2. Render the comment table (display all comments on the current page)
Formatting rules:
- The commenter column displays only the nickname; no avatar is shown and no hyperlink is generated
- Comment content exceeding 40 characters is truncated with ...
- Time is formatted as MM-DD HH:MM
- Pinned comments get a 📌 marker after the nickname (the entire row is bolded)
- like_count / reply_count numbers ≥ 10000 use the x.xw format
- Display everything on each page; no truncation allowed
A3. AI comment summary (⚠️ must be output for every query, including page turns)
First page: Based on the comments on the current page, four-dimensional sentiment analysis.
After page turn: Based on comprehensive analysis of the cumulative data of all pages retrieved so far, marking the cumulative total count.
Before analysis, one must understand Kuaishou community culture(the "laotie" culture, emoji semantics, and unique expressions such as "aoligei" and "double-tap").
📈 Comment summary analysis (based on {total} comments)
✅ Positive reviews ({positive_ratio}%)
- {key points, citing representative comment keywords}
⚠️ Negative reviews ({negative_ratio}%)
- {key points}
💡 User needs ({demand_ratio}%)
- {key points}
🔍 Competitor comparison public sentiment ({competitor_ratio}%)
- {output only when competitors are mentioned; otherwise output "No competitors mentioned"}
Analysis requirements:
- Each key point cites representative comment keywords/phrases
- The percentage is the proportion of that type of comment; the sum of the four categories may exceed 100%
- Must understand Kuaishou community culture
A4. Page-turn prompt (⚠️ immediately after A3)
- If has_next is true:
📄 当前第 {page} 页(共 {total_fetched} 条)。回复「下一页」继续查看。 - If has_next is false:
📄 当前第 {page} 页,已无更多数据。
⚠️ A1~A4 must be completed consecutively in the same round of output; no step may be omitted.
After A4 output is complete,ask the user whether an HTML visualization report needs to be generated:
📊 Do you need to generate an HTML visualization report?
If the user confirms, choose the method based on the number of pages browsed:
Only 1 page → single-page HTML (backfill_html.py)
The HTML file was already generated in Step 2; directly backfill the analysis data and open it:
python3 ~/.agents/skills/kuaishou-comment/scripts/backfill_html.py "<html_path>" --analysis-json '<分析JSON>'
open "<html_path>"
2 pages or more → consolidated report (consolidate_report.py)
Collect the JSON data of all browsed pages and generate one containingall comments and cumulative analysiscomplete HTML. Display in sections by page number,automatically collapse when there are more than 3 pages, and prompt the user to click to expand.
python3 ~/.agents/skills/kuaishou-comment/scripts/consolidate_report.py "<opusId>" \
--pages-json '[{"page":1,"total":31,"comments":[...]},{"page":2,"total":20,"comments":[...]}]' \
--analysis-json '<累计分析JSON>'
open "<html_path>"
| Parameter | Description |
|---|---|
| opusId | Kuaishou work opusId (positional parameter) |
| --pages-json | Multi-page data JSON array, each item containing page, total, comments |
| --analysis-json | Cumulative analysis JSON (fields same as backfill) |
pages data is collected from the output of each script call; cumulative analysis is based on the comprehensive analysis after A3 page turning.
Analysis JSON field description:
| Field | Type | Description |
|---|---|---|
| positive_ratio | string | Positive review percentage (pure number, e.g. "62", the template automatically appends %) |
| negative_ratio | string | Negative review percentage |
| demand_ratio | string | User demand percentage |
| competitor_ratio | string | Competitor comparison percentage |
| positive_summary | string | Positive review summary (HTML ul format) |
| negative_summary | string | Negative review summary |
| demand_summary | string | User demand summary |
| competitor_summary | string | Competitor comparison summary |
Step 4: Page turning handling (when the user replies "next page", etc.)
- Reuse opusId
- Use the nextCursor from the previous page
- Call the script again:
python3 ~/.agents/skills/kuaishou-comment/scripts/kuaishou_comment_search.py "<opusId>" --cursor "<nextCursor>" --page <page> - Fully execute A1~A4, with A3 based on cumulative comprehensive analysis
- After A4, ask whether HTML is needed
Page turning rules: has_next true → use nextCursor to turn the page; false → no more. Pass cursor through as-is; do not modify it.
Step 5: Error handling
| Error type | Handling method |
|---|---|
| No API Key | Prompt to configure REDFOX_API_KEY |
| Invalid work link | Prompt "No reviews found for this work, please check whether the work link is correct" |
| API returned an error | Display the error code and error message |
| 0 reviews retrieved | Prompt "This work currently has no reviews" |
| Network request timeout | Prompt "Network request timed out, please try again later" |
📋 Dependencies
The script uses urllib (Python standard library), no additional dependencies need to be installed.
🎯 Usage examples
Example 1: View reviews for a specified work
用户:查看快手作品 3x4ibfzs5e68yxu 的评论
助手:调用脚本 → 展示当前页 + AI总结 → 询问HTML → backfill → open
Example 2: Query via link
用户:https://www.kuaishou.com/short-video/3x4ibfzs5e68yxu 这个作品的评论怎么样
助手:提取 opusId → 调用脚本 → 展示分析 → 询问HTML
Example 3: Merge and export after page turning
用户:下一页 → 下一页 → 生成html
助手:收集3页JSON → consolidate_report.py → 1个HTML含全部评论+折叠 → open