Overview
Xiaohongshu Prohibited Word Lookup is an intelligent prohibited word detection tool designed specifically for Xiaohongshu content creators, brand operators, and marketers. Based on the 红狐Hub prohibited word detection API, it quickly scans copy for sensitive words before a note is published and provides context-aware intelligent replacement suggestions.
With simple copy input, you can:
- 🔍 Prohibited word marking — matched words in the original text are marked in bold, so risk points can be seen at a glance
- 💡 Replacement suggestions — each prohibited word is paired with a context-aware replacement word + reason for the change
- ✏️ Optimized copy — directly provides a publishable version after replacement, ready to use with copy and paste
- 📏 Batch detection for long copy — automatically reminds when over 3000 characters, supports batch detection and merging results
Trigger keywords:小红书违禁词 笔记敏感词 小红书审核 限流词 种草文案合规
Features
🎯 Core Features
| Input Method | Capability Description | Usage Examples |
|---|---|---|
| 💬 Paste copy directly | Paste note copy and detect with one click | 帮我看下这段笔记有没有违禁词:这款美白神器真的太有效了…… |
| 📎 Upload file | Supports TXT, DOC, DOCX, automatically reads and detects | Upload the document directly without manual copying |
| 🖼️ Upload image | Automatically extracts text from the image for detection | Just upload a note screenshot/poster |
| 🌐 Paste link | Automatically crawls web page content for detection | 帮我检测这个网页:https://example.com/article |
✨ Highlights
- ⚡ One-stop detection — four input methods: text/file/image/web page, completing all detection in one call
- 🔗 Cross-platform content extraction — built-in Playwright headless browser, supports content extraction from SPA pages with JS dynamic rendering
- 🌐 English false-match filtering — automatically identifies false positives from substrings inside English words (such as "ass" in "Glasswing"), no manual troubleshooting needed
- 🔒 Data security — detection content is sent via encrypted HTTPS and is not stored locally
- 📄 One-click export — automatically generates a plain-text optimized copy file and sends it as a card, ready to download and use
Limitation notes: the platform is fixed as Xiaohongshu and does not need to be specified. PDF is not supported; convert it to an image or text file before uploading.
One-click installation
Prerequisites
- Python 3.8+
- Install Python dependencies:
pip install python-docx==1.1.0 beautifulsoup4==4.12.3 playwright==1.58.0 - Install the Chromium browser:
playwright install chromium
Get API Key
- Visit 红狐Hub official website to learn about service details
- Go to registration page to register an account
- Newly registered users will receive free credits, and can immediately start using the API service
- After registering and logging in, get the API Key in the personal center, in the format
ak_xxxxxxxx
Configure API Key
The script automatically obtains the key in the following priority order:
| Priority | Source | Description |
|---|---|---|
| 1 | Environment variable REDFOX_API_KEY |
Read the current device environment variable directly |
| 2 | Shell configuration file | Automatically scan ~/.zshrc ~/.bashrc ~/.bash_profile ~/.profile ~/.zprofile |
| 3 | Prompt for configuration | If none of the above are found, prompt the user to configure manually |
Configuration example:
export REDFOX_API_KEY=ak_xxxxxxxx
Environment variable reference
| Variable name | Required | Description |
|---|---|---|
REDFOX_API_KEY |
Yes | Red Fox Hub API access key, format ak_xxxxxxxx |
XHS_SENSITIVE_WORD_API_URL |
No | Custom API endpoint address (uses Red Fox Hub official by default) |
XHS_SENSITIVE_WORD_VERIFY_SSL |
No | SSL certificate verification switch, default 1(enabled) |
Usage guide
Basic usage
💬 Paste text directly — Send the note text to the assistant to detect it
User: Help me check whether this note has prohibited words: This whitening miracle product is really so effective, after three days I became one shade whiter
Assistant output: 🔍 Prohibited word detection results → 💡 Revision suggestions → ✏️ Optimized text + plain text file card
📎 Upload file — Upload TXT, DOC, DOCX files directly, and the assistant automatically extracts the content for detection
🖼️ Upload image — Upload a note screenshot or poster, and the assistant extracts the text from the image and then detects it (text extraction only, no visual analysis of the image)
🌐 Paste link — Provide a webpage URL, and the assistant automatically scrapes the page text content for detection
Advanced usage
Batch detection for long text: When it exceeds 3000 characters, the assistant will pause and ask (reply 1=detect only the first 3000 characters in a single pass / 2=detect all in batches / 3=cancel); when batching, it automatically splits at natural sentence breaks
Text extraction preview only: Call script --extract-only parameter to extract text only without detection, returning the text content and length
Custom API endpoint: Set the XHS_SENSITIVE_WORD_API_URL environment variable to point to a self-built detection service
Command quick reference
| Input form | Assistant action |
|---|---|
| Plain text | Count characters → character count gate → --content="..." → three-section output |
| Upload TXT/DOC/DOCX | --file=path --extract-only Check character count → detect according to rules → three-section output |
| Upload image | Extract text from image only → count characters → --content="提取文字" → three-section output |
Paste https://... |
--url=... --extract-only Check character count → detect according to rules → three-section output |
| Extra-long text | Send a query message,continue only after receiving the user's explicit reply |
--content、--file、--url The three are mutually exclusive.
Complete execution procedure(output template, formatting iron rules, examples) see
references/core_workflow.md, and it must be read and strictly followed before calling scripts and formatting output.
Usage scenarios
Scenario 1: Self-check before publishing by a Xiaohongshu creator
Role: Xiaohongshu blogger, content creator
Needs: Quickly check for prohibited words before publishing recommendation notes, to avoid being throttled or taken down due to extreme words or prohibited promotional terms
How to use:
- Paste the note copy directly and send it to the assistant
- View the prohibited word detection results and replacement suggestions
- Copy the optimized copy or download a plain text file and publish it directly
Expected benefits: Get it right in one revision, publish with peace of mind, and reduce repeated revisions and review waiting time
Scenario 2: Batch mine sweeping for brand/e-commerce operations
Role: Brand operations, e-commerce operations
Needs: Batch detection of campaign poster copy, product detail pages, and multiple promotional copy pieces
How to use:
- Organize multiple copy sections into a DOC/DOCX document and upload it
- The assistant automatically extracts the content and detects all copy in batches
- Get detection results for each batch and a summary optimization file
Expected benefits: Batch mine sweeping improves efficiency and avoids complaints and takedowns after campaign launch
Scenario 3: Quick screening of advertising/marketing scripts
Role: Ad placement, marketing personnel
Needs: Quick review of multiple selling-point scripts and ad copy
How to use:
- Submit ad copy one by one or in batches
- Modify prohibited words according to the assistant's replacement suggestions
- Download the optimized copy and submit it for compliance review
Expected benefits: Shorten the review cycle and increase the approval rate of ad materials
Scenario 4: Spot checks by content review/growth teams
Role: Growth operations, content review
Needs: Compliance spot checks of plain text content on landing pages and H5 pages
How to use:
- Paste the landing page or H5 URL
- The assistant automatically captures the page text for detection
- View the detection results to confirm whether violations exist
Expected benefits: Quickly complete page compliance spot checks and reduce violation risks
Project architecture
Directory structure
xiaohongshu-prohibited-word/
├── SKILL.md # Skill 主文档(本文件)
├── skill-card.md # 技能市场卡片描述
├── _meta.json # 元数据
├── scripts/
│ └── check_sensitive_words.py # 核心检测脚本
│ ├── _get_api_key() # API Key 获取(环境变量 → Shell配置 → 提示)
│ ├── _http_request() # HTTP 请求(urllib 原生,内置重试)
│ ├── extract_from_file() # 文件文本提取(DOC/DOCX/TXT/CSV/MD 等)
│ ├── extract_from_web() # 网页文本提取(Playwright → urllib 回退)
│ └── check_sensitive_words() # 违禁词检测(API 调用 + 结果解析)
└── references/
└── core_workflow.md # 核心工作流(操作步骤、输出模板、格式铁律、示例)
Tech stack
| Component | Technology | Description |
|---|---|---|
| Runtime environment | Python 3.8+ | Standard Python environment |
| HTTP requests | urllib.request(standard library) |
Native HTTP requests with built-in retry and timeout handling |
| Document parsing | python-docx |
Word document text extraction |
| Web page parsing | beautifulsoup4 + playwright |
Dual engine for static HTML + JS dynamic rendering |
| API service | RedFox Hub prohibited word detection API | HTTPS POST, JSON format, X-API-KEY authentication |
FAQ
Installation-related
Q1: What should I do if it says "missing dependency library"?
A: Run the following command to install:
pip install python-docx==1.1.0 beautifulsoup4==4.12.3 playwright==1.58.0
playwright install chromium
Q2: What should I do if it says "missing credential configuration"?
A: Please follow the steps below:
- Visit https://redfox.hk/login?source=github to register and get an API Key (new users receive free credits)
- Configure environment variables:
export REDFOX_API_KEY=ak_xxxxxxxx - Or add it in
~/.bashrc/~/.zshrcand then executesource ~/.bashrc
Usage-related
Q3: How many characters can be detected at once?
A: It is recommended to keep it within 3000 characters at a time for the best results. For 3001–10000 characters, you will be asked whether to split the detection into batches; more than 10000 characters is not currently supported.
Q4: Are PDF files supported?
A: PDF is not supported. Please convert the PDF to an image or text file and upload it again.
Q5: Can the detection results be guaranteed to be 100% accurate?
A: The detection results are based on the Red Fox Hub prohibited words database and are for reference only. Please verify them yourself according to your business scope and the actual effects of the product; the final results are subject to review by the Xiaohongshu platform.
Troubleshooting
Q6: It says "Detection service is temporarily unavailable"?
A: The script has a built-in automatic retry mechanism. If it continues to fail, please check your network, confirm that the API Key has not expired, or visit the Red Fox Hub official website to confirm the service status.
Q7: Web page content extraction failed?
A: Please check whether the URL can be accessed normally. Some pages that require login or have anti-scraping protection may not be extractable; it is recommended to copy the text and paste it directly for detection instead.
Q8: Image text extraction is inaccurate?
A: Text extraction depends on image clarity and font. It is recommended to use high-definition screenshots and avoid handwritten fonts and decorative fonts.
Get Help
- 🌐 Red Fox Hub official website:https://redfox.hk/?source=github
- 📧 Contact email:graves9758@gmail.com