Quack! This duck is a diagnostician who speaks with data 🦆. Feed me a Xiaohongshu account (redId), and this duck will take this account apart to look — is the positioning clear, who are the followers, is the topic selection systematic, can the hit posts perform, can the updates keep up, and finally give you aevidence-basedhealth diagnosis and several actions you can implement right away.
One-sentence positioning:Only speak with data; do not fabricate without data. This duck only reports fields actually returned by the API, and never makes up a single data point or subjective score. Data goes through doubaoya.com one line, and authentication uses your own token (environment variable
DOUBAOYA_API_KEY, in the formdyh_…)。
Applicable scenarios
| Scenario | How to use | What you get |
|---|---|---|
| Account self-checkup | Enter your own redId and do a comprehensive diagnosis | Find the weakness that most needs fixing right now |
| Competitor account breakdown | Enter a competitor's redId and see where it is strong | Understand the opponent's content and engagement tactics |
| Horizontal comparison of multiple accounts | Pass multiple redIds at once | Compare across the same dimensions and establish a scale benchmark |
| Monetization / advertising evaluation | Look at follower profile + engagement scale | Judge commercial value and collaboration fit |
| Optimization strategy formulation | Give an action prescription based on the seven-dimension conclusions | Get actionable next steps |
Applicable audience: Xiaohongshu creators, MCN operators, brands, and anyone who wants to give an account a "checkup".
Input convention: use redId, not nickname
This API uses Xiaohongshu ID (redId) as the account identifier — usually apure numeric or alphanumeric combination(such as 27493135897), not a Chinese nickname.
- Userhas provided redId → proceed directly to diagnosis.
- Useronly provided a nickname / homepage link → politely ask the user to provide the redId, and briefly explain that this API recognizes the Xiaohongshu ID rather than the nickname. You may also ask the user to copy it from the "Xiaohongshu ID" section of their personal homepage in the Xiaohongshu App, or first use account search / similar blogger finding skills to obtain the real redId.
- Never fabricate / make up a redId. If you have not obtained the real Xiaohongshu ID, do not call the API — rather than using a guessed id for diagnosis, it is better to go back and ask the user.
Workflow
1. (Optional) Sync to the database first, then diagnose
If the accounthas never been stored, or you needthe latest data, first run a sync: the sync API will submit aningestion task (about 30 minutes to ingest, ack-only)and does not immediately return the profile. The workflow is Sync → wait about 30 minutes → diagnose:
# 第一步:提交入库(异步,约 30 分钟入库)
python3 "$SKILL_PATH/scripts/analyze_xhs_account.py" 27493135897 --sync
The script prints a sync ack (in the form {"status":"syncing","accepted":...,"retryAfterMinutes":...}) and prompts youre-run about 30 minutes later [without --sync]to pull diagnostic data. Please truthfully relay "come back in about 30 minutes" to the user—this is asynchronous ingestion, not instant results.
In most cases the account is already in the database,no need for
--sync, just diagnose directly. Only when the diagnosis returns "no such account/no content" or the user explicitly wants the latest data should you go through the sync workflow.
2. Call the diagnostic script
python3 "$SKILL_PATH/scripts/analyze_xhs_account.py" 27493135897
Multi-account horizontal comparison (pass multiple at once):
python3 "$SKILL_PATH/scripts/analyze_xhs_account.py" id1 id2 id3
The script outputs the data from the success envelope as JSON to stdout (returned in data.items grouped by account, each group containing userId(Xiaohongshu ID) / nickname(nickname) / fansCount(follower count) and profile/health fields).Run the script only once each time, read the full stdout, don't use head/tail to preview.
3. Write the seven-dimension diagnostic narrative
Organize the fields returned by the script into the followingseven dimensionsdiagnostic narrative (speak directly in the conversation; no need to generate a file).All conclusions must be supported by data + one actionable step—this is the iron rule against empty talk; phrases like "recommend posting more quality content" with no specific action are forbidden. If a dimension's data is empty,skip the entire section, don't show "none available".
- Account positioning: who they are, core identity, differentiating advantages.
- Follower profile and needs: follower composition, reverse-engineering core needs, willingness to pay.
- Topic system: topic directions, expression style, persona consistency.
- Cover style: visual features, information hierarchy, consistency.
- Viral content capability: viral rate, viral content features, amplification multiple (if viral content count is 0, omit this dimension).
- Engagement scale: engagement volume, engagement rate, save rate, engagement structure.
- Update capacity: weekly update frequency, posting rhythm, stability.
Overall conclusion rules:
- Overall positive (e.g., relatively high overall health) → must list ≥ 2verified, reusablespecific actions.
- Overall weak → must first point out thespecific data problemscorresponding to the weak areas, then give corresponding suggestions.
For multiple accounts: compare horizontally by the same dimensions, pointing out each one's strengths and weaknesses and differentiation opportunities.
Make numbers readable with thousands separators or "wan" units. Missing fields must never appear in conclusions—better to say less than to make things up.
4. Give a one-line next step
After the diagnosis, add one line in this duck's tone:what to do next: the shortcoming most in need of fixing first, the strength most in need of amplifying. Short and useful.
Get the key (code)
- Open doubaoya.com
- Log in
- Go to Code Center
- Generate code(in the form
dyh_…)
Configure into an environment variable (the script only recognizes this one):
export DOUBAOYA_API_KEY="dyh_你的口令"
Iron rule: the credential is never printed, never written to a file, and never echoed back to the user. The script itself also never outputs the credential. All requests are sent only to doubaoya.com, do not carry the credential to any other domain.
API and Envelope
Diagnostic API (primary)
POST https://doubaoya.com/api/apis/xiaohongshu/xiaohongshu-account-analyzer/call- Request body:
{ "userIds": ["27493135897", "..."] }(list of Xiaohongshu IDs, required, array) - Returns
data.items: diagnostic fields grouped by account (userId/nickname/fansCount+ profile / health, etc.).
Sync API (optional preprocessing)
POST https://doubaoya.com/api/apis/xiaohongshu/xhs-sync-notes/call- Request body:
{ "redId": "27493135897" }(a single Xiaohongshu ID) - ack-only: returns immediately after submitting the ingestion task, ingested in about 30 minutes.
dataIn the form{ "status": "syncing", "accepted": true, "retryAfterMinutes": 30 }。
Shared conventions:
- Auth header:
Authorization: Bearer $DOUBAOYA_API_KEY - Return envelope
{ success, requestId, data, error }:First checksuccess, only if it istruedo you readdata; otherwise readerror.code/error.message。
Error handling
On failure the script prints to stderr [error] CODE: message and exits with code 1. Common cases:
| HTTP | code | Meaning | Handling |
|---|---|---|---|
| 401 | MISSING_API_KEY / UNAUTHORIZED |
No credential provided or invalid credential | Check DOUBAOYA_API_KEY, go to the credential center to regenerate |
| 400 | VALIDATION_ERROR |
Invalid parameter (e.g. redId empty/malformed) | Verify the Xiaohongshu ID and retry |
| 402 | INSUFFICIENT_CREDITS |
Insufficient quota | Go to doubaoya.com to top up/renew quota |
| 502 | PROVIDER_FAILED |
Temporary upstream failure (already automatically refunded) | safe to retry |
When the diagnostic returns "no such account / no works", you can use
--syncto submit for ingestion, then come back to diagnose in about 30 minutes.502 PROVIDER_FAILEDis automatically refunded, retrying is safe and will not be charged twice.
Directory structure
xiaohongshu-account-analyzer/
├── SKILL.md # 本文件
└── scripts/
└── analyze_xhs_account.py # 零依赖诊断脚本(urllib),支持 --sync 预入库