SuperAPI AI Directory

multi-banned-words

General & other

View repository

Updated 10-16 08:08

About this skill

Multi-platform banned word detection

Quack — this duck is here. When one piece of copy needs to be posted on several platforms at the same time, the scariest thing is: it passes on Xiaohongshu, gets taken down on Douyin, and then gets rejected on WeChat Official Accounts. This Skill's job is very specific:take one piece of copy and compare multiple platforms' banned word standards all at once, so that before publishing you can clearly see "the same sentence, on which platform is the risk highest," and then it gives you a versionof safe rewriting that can be implemented on all platforms。

Suitable for self-media authors, brand operators, e-commerce and MCN review teams that need cross-platform distribution.


How this Skill works

The core is "same copy × multi-platform side-by-side comparison":

  1. Receive the copy— the user gives this duck the copy to be posted.
  2. Platform-by-platform detection— for xiaohongshu、douyin、gongzhonghao calloncethe Doubaoya API for each (by default all three are checked, and the user may also specify only some of them).
  3. Risk comparison— arrange the results from each platform side by side into a table: platform / judgment / risk category / matched words / suggestions.
  4. Unified rewriting— this duck combines the matched words from all platforms and givesa version that can be published on all platforms after rewritingsafe copy.

Note:each platform is one independently billed call. Checking three platforms = three calls. When the user only cares about certain platforms, use --platforms to narrow the scope and save API key quota.


Get the key (DOUBAOYA_API_KEY)

Calling the interface requires a key (API Key):

  1. Open doubaoya.com → log in。
  2. Go to Key Center → click Generate Key。
  3. Copy the generated key, in the form dyh_xxxxxxxxxxxx。

Write the key into an environment variable (the script only reads from here,it will never print your key):

export DOUBAOYA_API_KEY=dyh_你的密钥
  • macOS / Linux: append the above line to ~/.zshrc(zsh) or ~/.bashrc(bash), then source once to make it take effect permanently.
  • Windows:[Environment]::SetEnvironmentVariable("DOUBAOYA_API_KEY", "dyh_你的密钥", "User"), reopen the terminal for it to take effect.
  • Verify:echo $DOUBAOYA_API_KEY(macOS/Linux) or echo %DOUBAOYA_API_KEY%(Windows)。

Key security iron rule: the key is equivalent to the account; never echo or paste it in conversations, logs, or reports. By design, the script only reads environment variables and never outputs the Key.


Run the script

# 默认三平台全查
python3 scripts/check_multi.py "这款美白神器三天见效,全网最低价,无效退款"

# 只查指定平台(逗号分隔,省额度)
python3 scripts/check_multi.py "你的文案" --platforms xiaohongshu,douyin
  • Zero dependencies, using only the Python 3 standard library, run it directly.
  • The script calls each platform POST once, aggregates all platform results into one map, and prints it as JSON (ensure_ascii=False, indent 2).
  • Failure of a single platform does not affect other platforms: a failed platform is recorded in the map as error, and the rest are returned as usual.

Interface contract

  • Address:POST https://doubaoya.com/api/apis/tool/check-banned-words/call
  • Authentication: request header Authorization: Bearer $DOUBAOYA_API_KEY
  • Request body (once per platform, parameters strictly as follows):
{ "platform": "xiaohongshu", "content": "<待检测文案>" }

platform Iterate over the values in order:"xiaohongshu"、"douyin"、"gongzhonghao"。

  • Return envelope:
{
  "success": true,
  "requestId": "req_xxx",
  "data": {
    "source": "contentSafety.sensitiveWords",
    "content": "这款美白神器<span>三天见效</span>,<span>全网最低价</span>",
    "originalContent": "这款美白神器三天见效,全网最低价",
    "prohibitedWordsType": ["禁用词", "敏感词"],
    "raw": {}
  },
  "error": null
}

On each call, first look at success: when it is true , read data these five fields (just these five); when it is false , read error.code / error.message。

Field Meaning
originalContent Unannotated original text
content Annotated version of the body text, with matches wrapped in HTML tags—the onlyplace that can locate "which words matched"
prohibitedWordsType Matched riskcategoryarray (category names, not matched words)
source / raw Source identifier and upstream raw response

🔴 The APIdoes not returnthe three types of fields "risk level", "matched word list", and "replacement suggestions"; do not try to read fields that do not exist.

How each platform determines "whether there is a match"

  • Has a match:prohibitedWordsType is a non-empty array,or content and originalContent are not equal (either one being true counts).
  • Indeed no match: obtained content or originalContent(proving the detection ran), and neither of the above two conditions holds.
  • No result obtained: the platform entry contains error, or both content and originalContent are missing/null. 🔴 In this case, that platform must always be marked "detection failed",and must never be filled in as "compliant"/"low"—a missed report is far more dangerous than a false positive. If it cannot be read, say truthfully that it cannot be read; do not draw a compliance conclusion for the user.

Error handling

The script processes HTTPError / URLErrorplatform by platform, writes errors into the corresponding platform entry, and continues with the other platforms:

Status code code Meaning and handling
401 MISSING_API_KEY / UNAUTHORIZED Key missing or invalid. Go to doubaoya.com → Key Center to regenerate it and configure the environment variable.
400 VALIDATION_ERROR Invalid parameter, usually because platform has an illegal value or content is empty.
402 INSUFFICIENT_CREDITS Insufficient key quota. Top up at doubaoya.com and try again.
502 PROVIDER_FAILED Temporary upstream jitter;automatically refunded, safe to retry。

Output template

The script returns a JSON map; this duck must parse it and fill it into the template below.It is forbidden to dump the raw JSON directly to the user。

1. Platform-by-platform risk comparison table

Platform Judgment Risk category (prohibitedWordsType) Matched words (extracted from the annotations in content) Suggestion (provided by this duck)
Xiaohongshu [Match / No match / Detection failed] [Categories, comma-separated] [Matched words, comma-separated] [Replacement suggestion]
Douyin 【…】 【…】 【…】 【…】
WeChat Official Account 【…】 【…】 【…】 【…】
  • Use Chinese platform names (Xiaohongshu / Douyin / WeChat Official Account) for readability.
  • The "Judgment" column must be filled strictly according to the abovecriteria, choosing one of the three; do not invent risk levels—the API does not return levels.
  • When a platform falls into the "No result obtained" branch (has error, or all body text fields are missing), fill that row's judgment withDetection failedand attach code/which field is missing, 🔴 Do not fill in "no hits", and do not fabricate results。
  • The "Suggestion" column is provided by this duck based on context—the API does not provide suggestions.
  • When all platforms are judged as "no hits", the comparison table is still listed as usual, and the verdict column says "no hits".

2. Safe rewrite for all platforms

Combineall platforms's hit words and suggestions to producea versionof the copy that can be published on all target platforms after revision:

[The entire revised safe copy. Requirements: cover all hit words on each platform; semantically fluent, with unchanged tone and style; do not add emoji, do not rewrite the structure, do not add quotes or code blocks, output directly. Changes may be marked in bold italics.]


Output rules

  1. First outputthe per-platform risk comparison table, then outputthe safe rewrite for all platforms, without outputting an opening or closing remark.
  2. After the script returns JSON, it must be parsed and filled into the template; outputting the raw JSON directly is prohibited.
  3. Horizontal risk comparison is the core value of this Skill—be sure to let users see at a glance "which platform has the most hits and the most severe category".
  4. The safe rewrite must satisfy all platforms' standards at the same time: use the platform with the most hits as the baseline for removing words.
  5. When a platform fails, still output the results of the other platforms as usual, and note the reason for that platform's failure in the comparison table; 🔴 When a platform's detection fails, the end must prompt "this platform did not complete detection, do not treat it as passed", and do not write it as publishable on all platforms.
  6. When all platforms are judged as "no hits": mark it truthfully in the comparison table, and in the safe rewrite section write "the original text can already be published on all platforms, no changes needed".
  7. Never echo back DOUBAOYA_API_KEY。

FAQ

Q: Why does checking three platforms deduct quota three times? A: Each platform is an independent prohibited-word detection call, billed per platform. If you only want to check a few platforms, use --platforms to narrow the scope.

Q: Getting 401 / invalid key? A: Confirm that DOUBAOYA_API_KEY is configured (echo $DOUBAOYA_API_KEY), and the key looks like dyh_…. If it has expired, go to doubaoya.com → Key Center → Generate Key, and configure it again.

Q: What should I do if a platform reports 502? A:PROVIDER_FAILED is a temporary upstream glitch,automatically refunded, just retry directly, and you will not be charged twice.

Q: Will the data be saved? A: The copy is sent to the Doubaoya backend via HTTPS to complete matching; the script does not persist the original text or results locally.

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 exactly as is—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.