WeChat Official Account Article Aggregator
Batch fetch the latest articles of specified WeChat Official Account authors via the mptext.top API, download and parse them into Markdown/HTML/plain text formats for output.
Quick Start
Fetch the latest 2 articles from a single official account:
bash
python scripts/fetch_articles.py --api-key YOUR_KEY --fakeids "MzkzNDQxOTU2MQ=="
Fetch articles from multiple official accounts (comma-separated fakeids):
bash
python scripts/fetch_articles.py --api-key YOUR_KEY --fakeids "MzkzNDQxOTU2MQ==,MjM5NDI4MTY3NA==" --limit 3
Fetch by official account name:
bash
python scripts/fetch_articles.py --api-key YOUR_KEY --fakeids "赛博禅心,饼干哥哥AGI"
Fetch articles from all pre-configured official accounts:
bash
python scripts/fetch_articles.py --api-key YOUR_KEY --fakeids all --limit 2
Dependency Installation
bash
pip install requests beautifulsoup4 html2text
Minimum Dependencies: Only
is a required dependency.
and
are used to enhance Markdown conversion effects. If not installed, the built-in HTML parser will be used.
User Parameter Description
| Parameter | Type | Required | Default Value | Description |
|---|
| / | string | Yes | - | mptext.top API Key |
| / | string | Yes | - | Official account fakeid list (comma-separated), official account name, or |
| / | int | No | 2 | Number of articles fetched per official account |
| / | string | No | | Output directory |
| / | string | No | | Output format: / / / |
| / | string | No | Auto find | Path of custom official account list JSON file |
| / | float | No | 1.0 | Request interval in seconds |
| flag | No | - | List all pre-configured official account information |
How to Get API Key
The API Key comes from the mptext.top platform and is used to authenticate article fetch requests. It is passed in the request header as
.
fakeid Explanation
is the unique identifier of WeChat Official Accounts (Base64 encoded biz parameter), which can be obtained in the following ways:
- View in the WeChat Official Account Platform backend
- Extract from the parameter in the official account article URL
- Use the pre-configured account list of this skill
Feature Description
1. Fetch Article List
Call the mptext.top API to fetch the latest article list of the specified official account:
bash
python scripts/fetch_articles.py --api-key YOUR_KEY --fakeids "MzkzNDQxOTU2MQ==" --limit 5
2. Download and Parse Article Content
After obtaining the article HTML, automatically extract the
body area and convert it to Markdown format:
bash
python scripts/fetch_articles.py --api-key YOUR_KEY --fakeids "赛博禅心" --format markdown
3. Batch Fetch Multiple Official Accounts
Fetch the latest articles from multiple official accounts at the same time:
bash
python scripts/fetch_articles.py --api-key YOUR_KEY --fakeids "赛博禅心,饼干哥哥AGI,老金开源" --limit 3
4. Fetch All Pre-configured Official Accounts
Use the
keyword to fetch articles from all pre-configured official accounts:
bash
python scripts/fetch_articles.py --api-key YOUR_KEY --fakeids all
5. View Pre-configured Official Account List
bash
python scripts/fetch_articles.py --api-key dummy --fakeids dummy --list-accounts
6. Call as a Python Library
python
import sys
sys.path.insert(0, 'scripts')
from fetch_articles import get_article_list, download_article_html, extract_markdown_from_html, load_accounts, resolve_fakeids, fetch_all
api_key = "YOUR_API_KEY"
# Get article list of a single official account
articles = get_article_list(api_key, "MzkzNDQxOTU2MQ==", limit=2)
for art in articles:
print(art['title'], art['url'])
# Download and parse article content
html = download_article_html(api_key, articles[0]['url'])
markdown = extract_markdown_from_html(html, title=articles[0]['title'])
print(markdown[:500])
# Batch fetch multiple official accounts
accounts = load_accounts()
fakeids = resolve_fakeids("赛博禅心,饼干哥哥AGI", accounts)
summary = fetch_all(api_key, fakeids, limit=2, output_dir="./output")
print(f"Success: {summary['success']}, Fail: {summary['fail']}")
Output Structure
output/
├── 赛博禅心/
│ ├── 文章标题1.md
│ └── 文章标题2.md
├── 饼干哥哥AGI/
│ ├── 文章标题1.md
│ └── 文章标题2.md
├── 老金开源/
│ └── ...
└── summary.json # Metadata summary of all articles
summary.json Format
json
{
"fetch_time": "2026-02-23T17:30:00",
"total_accounts": 3,
"total_articles": 6,
"success": 5,
"fail": 1,
"accounts": [
{
"fakeid": "MzkzNDQxOTU2MQ==",
"name": "赛博禅心",
"articles": [
{
"title": "文章标题",
"url": "https://mp.weixin.qq.com/s/...",
"create_time": "1708689600",
"saved_path": "output/赛博禅心/文章标题.md",
"status": "success"
}
]
}
]
}
API Interface Description
Article List Interface
GET https://down.mptext.top/api/public/v1/article?fakeid={URL_ENCODED_FAKEID}&limit={N}
| Parameter | Description |
|---|
| fakeid of the official account, requires URL encoding ( → ) |
| Number of articles returned |
Request Header:
X-Auth-Key: {YOUR_API_KEY}
Response Example:
json
[
{
"title": "文章标题",
"url": "https://mp.weixin.qq.com/s/xxxxx",
"create_time": 1708689600
}
]
Article Download Interface
GET https://down.mptext.top/api/public/v1/download?url={URL_ENCODED_ARTICLE_URL}&type=html
| Parameter | Description |
|---|
| WeChat article URL, requires URL encoding |
| Fixed as (API returns HTML format) |
Request Header:
X-Auth-Key: {YOUR_API_KEY}
Response: Complete WeChat article HTML page.
HTML Body Parsing Rules
Extract body content from the downloaded HTML:
- Locate the div element with
- Remove content of , , tags
- Extract text content, retain paragraph line breaks
- Use to convert to Markdown (if installed)
Pre-configured Official Account List
| No. | Official Account Name | Category | FakeID |
|---|
| 1 | 饼干哥哥AGI | AI Programming | |
| 2 | 赛博禅心 | AI Frontier | |
| 3 | 可怜的小互 | AI Technology | |
| 4 | 宝玉的工程技术分享 | Technical Translation | |
| 5 | 苍何 | AI Practice | |
| 6 | 老金开源 | Claude Code | |
| 7 | 玩转AI工具 | AI Tools | |
| 8 | 袋鼠帝AI客栈 | AI Practice | |
You can specify a custom official account list JSON file via the
parameter for expansion.
Notes
- API Key Security: Do not hardcode the API Key into the code, it is recommended to pass it through environment variables or command line parameters.
- Request Frequency: The default interval is 1 second. If you encounter a 429 error, please increase the value.
- HTML Parsing: The download interface returns a complete HTML page, and the script automatically extracts the body from the area.
- Dependency Degradation: When and are not installed, use the built-in HTMLParser to extract plain text.
- File Naming: Output files are named after the article title, special characters are automatically removed, and the length is truncated to 80 characters.
Trigger Keywords
- "Fetch official account articles"
- "Crawl WeChat articles"
- "Official account article aggregation"
- "Batch fetch official accounts"
- "Download official account articles"
- "WeChat article collection"
- "Fetch latest official account articles"
Changelog
v1.0.0 (2026-02-23)
- Initial version
- Support fetching official account article list via mptext.top API
- Support downloading article HTML and parsing into Markdown/HTML/Text/JSON
- Built-in HTMLParser to extract body (zero-dependency degradation solution)
- Pre-configured fakeids of 8 popular AI tech official accounts
- Support fetching by official account name or fakeid
- Support keyword to fetch all pre-configured official accounts
- Automatically generate summary.json to aggregate metadata