Your WeChat Official Account content search engine. Enter any keyword to search WeChat Official Account articles in real time, with clear display in a terminal table: title, author, read count, like count, share count, favorite count, and publish time. Export data to Excel with one click and generate an interactive HTML report with a search box.
API Source:
公众号搜索SkillHub— All API requests carry this identifier to distinguish the call source of different Skills.
First Use
Ready to use out of the box — paste the command and run
Built-in public API Key, about 10,000 free quota, zero configuration and use directly:
# 搜索公众号文章
python3 "$SKILL_PATH/assets/search.py" "人工智能"
Specify sorting method and number per page
python3 "$SKILL_PATH/assets/search.py" "AI Agent" --sort-type default --page-size 20
Generate and open an interactive HTML reportpython3 "$SKILL_PATH/assets/search.py" "large model" --open
HTML 报告页面内置搜索框,支持实时调接口查询任意关键词的公众号文章,结果以卡片形式展示(标题、作者、阅读/点赞/分享/收藏数据),点击卡片直跳原文阅读。
CSV 数据文件保存在 `~/Downloads/QoderGzhSearch/` 目录。
---
## 后续使用
免费额度用完后,前往 [redfox.hk/login](https://www.redfox.hk/login) 注册账号获取自己的 API Token:
| 配置方式 | 说明 | 命令 |
|----------|------|------|
| **环境变量**(推荐) | 设置一次,全局生效 | `export X_API_KEY=ak_你的密钥` |
| **命令行参数** | 临时使用 | `python3 "$SKILL_PATH/assets/search.py" "关键词" --api-key ak_你的密钥` |
| **配置文件** | 持久化存储 | `echo '{"api_key":"ak_你的密钥"}' > ~/.qoder/apis/redfox.json` |
---
## 功能特点
- **关键词搜索**:输入任意关键词,实时查询微信公众号文章
- **终端表格展示**:标题、作者、阅读数、点赞数、分享数、收藏数、发布时间一览无余
- **数据导出**:搜索完成后自动生成 CSV 文件,方便数据分析
- **HTML 交互报告**:生成自包含 HTML 页面,内置搜索框支持实时调接口查询
- **原文直达**:在 HTML 报告中点击任意文章卡片,直接跳转到公众号文章阅读链接
- **本地服务模式**:内置 HTTP 服务代理 API 请求,避免浏览器跨域限制
---
## 使用方式
### 基础搜索
```bash
# 搜索指定关键词的公众号文章
python3 "$SKILL_PATH/assets/search.py" "人工智能"
# 一次搜索多个关键词(分别执行,可手动多次调用)
python3 "$SKILL_PATH/assets/search.py" "AI Agent"
python3 "$SKILL_PATH/assets/search.py" "大模型"
python3 "$SKILL_PATH/assets/search.py" "ChatGPT"
Advanced Parameters
# 指定获取数量(API 每页固定约 20 条,多页自动翻页)
python3 "$SKILL_PATH/assets/search.py" "AI" --count 50
# 不自动打开浏览器
python3 "$SKILL_PATH/assets/search.py" "AI" --no-open
# 指定输出目录
python3 "$SKILL_PATH/assets/search.py" "AI" --output-dir ~/Desktop
# 只生成 CSV 不生成 HTML
python3 "$SKILL_PATH/assets/search.py" "AI" --csv-only
Interactive HTML Report
After running a search, an HTML report is automatically generated and the browser opens. Enter keywords in the search box on the HTML page to call the API in real time and search for more WeChat Official Account articles without rerunning the script.
Report features:
- Dark theme, responsive layout
- Search box supports debounced input (300ms delay)
- Each article displays: title, author, read count, like count, share count, favorite count, and publish time
- Click an article card to jump directly to the original WeChat Official Account article
- Supports paginated loading of more results
Parameter Description
| Parameter | Description | Default Value |
|---|---|---|
keyword |
Search keyword (required, positional parameter) | — |
--count |
Number of articles to retrieve, automatically paginates across multiple pages | 20 |
--sort-type |
Sorting method: default / time | default |
--output-dir |
Output directory | ~/Downloads/QoderGzhSearch |
--api-key |
Specify API Key | — |
--open |
Automatically open the browser to view the HTML report | Enabled by default |
--no-open |
Do not automatically open the browser | — |
--csv-only |
Generate only a CSV file, not HTML | — |
--port |
Local service port for the HTML report | 8766 |
Dependency Installation
| Dependency | Installation Command |
|---|---|
requests |
pip3 install requests |
FAQ
Q: What is the search scope? A: Searches the full set of WeChat Official Account articles, not limited to a specific field or account.
Q: What is the maximum number of records returned at one time?
A: A single request returns 20 records by default, which can be adjusted via --page-size . The HTML report page supports paginated loading of more results.
Q: Where is the data saved?
A: CSV files are saved by default in ~/Downloads/QoderGzhSearch/, with the filename format 公众号搜索_[关键词]_2026-05-27.csv。
Q: Why does the HTML report need a local service? A: When opening an HTML file directly in the browser, cross-origin restrictions may exist, preventing direct calls to the redfox.hk API. A built-in local HTTP service acts as a proxy relay to ensure the search function works properly.
Q: Does the search include article cover images? A: The search API does not currently return cover images. The HTML report uses the first character of the article title as the card's visual identifier.
Q: What should I do when the quota is used up? A: Go to redfox.hk/login to register and obtain a free API Token.
How to Obtain
This Skill can be found on the following platforms: