SuperAPI AI Directory

xiaohongshu-write

General & other

View repository

Updated 10-16 08:08

About this skill

Xiaohongshu Note Creation (Doubao Duck)

Quack! This duck specializes in curing "not knowing how to start writing." Give this duck a topic keyword, and this duck will first retrieve the notes currently going viral in this niche,reviewwhy they went viral—how the opening hooks people, how the substance is laid out, how the ending drives interaction, how the tags are applied—and then, following this traffic code, produce for you a smooth, compliant, ready-to-publish Xiaohongshu note.

This toolonly executes in the main Agent and is not dispatched to sub-agents—because the entire set of intent understanding, viral review, style fusion, and final writing all depends on the global conversation context.

Data goes through doubaoya.com one line, authentication uses your own key (environment variable DOUBAOYA_API_KEY, in the form dyh_…)。


Applicable scenarios

Scenario How to use What you get
Beginners writing notes from scratch Give a topic word, and this duck produces the whole piece according to viral patterns Directly lowers the creation threshold
Operations producing drafts in bulk Generate differentiated copy for each niche word one by one Efficiently produce multiple pieces
Customized brand seeding Write with product information + style samples together Hits viral patterns while fitting the brand tone
Optimizing and rewriting old drafts Use existing copy as a style reference and rewrite Upgrade by riding the latest viral patterns

Creation workflow (retrieve → review → write)

Three core steps:First retrieve the viral hits in this niche → review their traffic code → then write publishable copy based on them.

Step 1 · Retrieve viral hits (fetch data)

  1. Extract keywords: extract precise topic words from the user's needs.
    • Niche words / vertical tracks (such as 减脂餐、小个子穿搭) → retrieve directly.
    • General words / broad categories (such as 穿搭、美食) → first recommend 10 niche directions, stop and wait for the user to choose before retrieving (do not force-search with broad categories).
  2. Call the script to fetch data(the script only fetches data, it does not analyze):
    python3 "$SKILL_PATH/scripts/search_xhs_work.py" "减脂餐"
    
    If you want more entries for review, you can paginate / increase the number of entries per page:
    python3 "$SKILL_PATH/scripts/search_xhs_work.py" "减脂餐" --page 1 --page-size 20
    
    The script prints the data from the success envelope to stdout as JSON.Review based on this batch of data, but it is forbidden to throw the entire raw viral list to the user—what the user wants is finished copy, not a data table.

Step 2 · Review viral hits (distill the traffic code)

Based on data.items this batch of viral hits, distill patterns from several dimensions (not shown to the user, used internally to guide the writing):

Dimension What to review
Title Common traits of high-interaction titles: numbers, emotional words, audience labels, length and sentence patterns (question/exclamation/pain point)
Opening hook How do the first two lines hook people—create pain points / build suspense / give a promise
Value structure How to lay out the body: point-by-point explanation / step-by-step tutorial / comparison display / list format
Interaction scripts How to drive comments, saves, and follows at the end
Hashtag strategy High-frequency hashtag types, trending topic hashtags
Data signals Look at likedCount(likes),totalScore(composite score) for sorting, prioritize the few posts with the highest scores/interactions

Optional: use web search to supplement 1–2latest hot topicsfor this topic as creative material to make the copy fresher.

Step 3 · Writing (produce a publishable note)

  1. Ask about style first(Do this once): "Want this duck to understand your style better? Just send a few of your usual notes / casual writings to this duck."
    • If the user provides them → analyze their word choice, tone, and expression habits, and blend them into the copy.
    • If not → write directly according to viral patterns.
  2. Create strictly according to the review results: The title hits viral sentence patterns (≤ 20 characters), the opening uses viral hook techniques, the body incorporates high-frequency keywords and the latest hot topics, is divided into points according to viral structure, well paragraphed, lightly dotted with a few Emoji, and the ending adds interaction guidance.
  3. Self-check before output: 3 recommended titles6 ✓, complete publishable body ✓, 510 hashtags ✓, viral formula sources (patterns + 2–3 core reference notes, including title/author/interaction data) ✓.

Output format (strictly follow)

### 推荐标题
1. [标题1]
2. [标题2]
3. [标题3]

### 正文内容
[完整可发布的正文,含分段与少量 Emoji]

### 推荐标签
#标签1 #标签2 #标签3 #标签4 #标签5

### 爆款公式来源
**参考的爆款规律**:[如"数字型标题 + 痛点开场 + 分点干货 + 互动收尾"]
**参考的爆款笔记**(2~3 篇,优先互动/评分最高):
1. [笔记标题] - @作者名 - 点赞 X / 综合评分 X
2. …

Prohibited: only dumping data without writing the piece, replying only with "saved" or a file path, displaying the entire original viral list, generating cards/images. Do not ask the user "what is your real purpose", and do not fabricate data.


Get the key (secret key)

  1. Open doubaoya.com
  2. Log in
  3. Go to Key Center
  4. Generate key(in the form dyh_…)

Configure it into environment variables (the script only recognizes this):

export DOUBAOYA_API_KEY="dyh_你的密钥"

Iron rule: the secret key must never be printed, never written into a file, and never echoed back to the user. The script itself also never outputs the secret key. All requests are sent only to doubaoya.com, and do not take the secret key to any other domain.


API and envelope

  • POST https://doubaoya.com/api/apis/xiaohongshu/search-work/call
  • Auth header:Authorization: Bearer $DOUBAOYA_API_KEY
  • Request body:
    { "keyword": "减脂餐", "page": 1, "pageSize": 20 }
    
    • keyword: string, required
    • page: integer, optional (default 1)
    • pageSize: integer, optional (default 20)
  • Return envelope:
    {
      "success": true,
      "requestId": "...",
      "data": { "items": [ { "title": "…", "authorNickname": "…", "likedCount": 56000, "totalScore": 92 } ] },
      "error": null
    }
    
    • data.items: viral note list (each item contains title title,authorNickname author,likedCount likes,totalScore composite score)
  • Check successfirst: only if it is true read data; otherwise read error.code / error.message。

Error handling

When the script fails, print to stderr [error] CODE: message and exit with code 1. Common cases:

HTTP code Meaning Handling
401 MISSING_API_KEY / UNAUTHORIZED No key provided or invalid key Check DOUBAOYA_API_KEY, and go to the Key Center to regenerate it.Do not echo the key
400 VALIDATION_ERROR Invalid parameters (e.g., keyword is empty) Fix the keyword and retry
402 INSUFFICIENT_CREDITS Insufficient quota Go to doubaoya.com to top up/renew quota
404 ENDPOINT_NOT_FOUND Incorrect API path Usually the script has been modified; restore the default endpoint path
502 PROVIDER_FAILED Temporary upstream failure (automatically refunded) Safe to retry
— NETWORK_ERROR Cannot connect to doubaoya.com Check your network and retry

502 PROVIDER_FAILED will be automatically refunded; retrying is safe and will not result in duplicate charges. When data is insufficient, prioritize switching to shorter/broader keywords, or paginate to get more samples; do not fabricate data.


Directory structure

xiaohongshu-write/
├── SKILL.md                  # 本文件:检索 → 复盘 → 成文 全流程指引
└── scripts/
    └── search_xhs_work.py    # 零依赖检索脚本(urllib),只取数;复盘/成文交给主 Agent

About the notice field in the response

After calling the doubaoya API corresponding to this skill, if the returned JSON has a top-level notice field, please relay this sentence to the user verbatim—this is a notice that this skill has an update, it does not affect the result of this call, and no retry or behavior change is needed.