Skip to content

About

公众号历史文章批量导出成 Markdown 和 CSV,不用扫码、不用后台、不用 Cookie / Export WeChat Official Account articles to Markdown and CSV, no login

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

wechat-article-export:公众号历史文章批量导出

把微信公众号的历史文章批量导出成 Markdown 和 CSV(Excel 能直接打开)。给公众号名字就能跑,不用扫码,不用公众号后台,不用 Cookie,所以不会碰到 200013 频率限制,也不用换号。

一个脚本,不用装依赖,Python 3.9 以上就能跑。

git clone https://github.com/data-x-api/wechat-article-export
cd wechat-article-export

python3 export.py 36氪 --limit 5 --full-text          # 先看最多花多少钱,这一步不调用
python3 export.py 36氪 --limit 5 --full-text --yes    # 确认后真跑

真跑需要一个 DataXAPI 的 Key:注册(可免费试用,最多 333 次),然后 export DATAXAPI_API_KEY=dx_...。

导出来是什么

export/36氪/
├── index.csv                                    # 发布时间、标题、链接、摘要、是否有全文
├── 2026-11-05_41岁,他登顶江西首富.md
├── 2026-11-05_价格暴涨,山姆限购,黄牛盯上零食顶流.md
└── ...

每篇 Markdown 开头是标题、公众号、发布时间和原文链接,下面是正文。不加 --full-text 时只有摘要。

花多少钱

每次调用 $0.02,失败不扣费。

做什么 调用次数
公众号名字换成编号(直接给 gh_ 编号就省了) 每个号 1 次
文章列表 每页 1 次
全文(--full-text) 每篇 1 次

例:一个号导出 5 篇全文,$0.02 + $0.02 + 5 × $0.02 = $0.14。跑之前会先打印最多花多少,加 --yes 才调用。

重跑不重复花钱: 已经有全文的文章不会再取,中途断了接着跑就行。

翻很多页时花的主要是列表的钱,一个号要读多少页差别很大,见真实读完一批号要花多少。

一次真实运行

2026-11-05(北京时间):

$ python3 export.py 36氪 --pages 1 --limit 3 --full-text --yes
最多花 $0.10:1 个号,每个最多 1 页、3 篇全文,每次调用 $0.02;失败不扣费
36氪(gh_240fbf8b33e4):新存 3 篇,已有不重取 0 篇 → export/36氪/
调用 5 次,其中失败 0 次(不扣费),实际扣费 $0.1000

$ python3 export.py gh_240fbf8b33e4 --limit 1 --full-text --yes
gh_240fbf8b33e4:新存 1 篇,已有不重取 0 篇 → export/gh_240fbf8b33e4/
调用 2 次,其中失败 0 次(不扣费),实际扣费 $0.0400

$ python3 export.py gh_240fbf8b33e4 --limit 1 --full-text --yes     # 再跑一遍:不重取全文
gh_240fbf8b33e4:新存 0 篇,已有不重取 1 篇 → export/gh_240fbf8b33e4/
调用 1 次,其中失败 0 次(不扣费),实际扣费 $0.0200

参数

参数 默认 说明
公众号 必填 名字或 gh_ 编号,可以给多个。名字要完全一样,不一样时会列出相近的,不会猜
--pages N 1 每个号最多翻几页,从最新的开始
--limit N 页数 × 20 每个号最多导出几篇,这也是“最多花多少”的封顶
--full-text 关 每篇多调一次取全文
--out DIR export 导出目录
--yes 关 确认花费,真正运行

想让 AI 帮你读一批号

把下面这段发给 Claude Code、Codex 或 Cursor:

读 https://github.com/data-x-api/wechat-article-export 的说明。
帮我导出这些公众号最近 20 篇的全文:xxx、xxx、xxx。先告诉我最多花多少钱,我确认后再跑。

说明

  • 这是 DataXAPI 的示例项目,不是微信或腾讯的官方项目。脚本里只有调用接口的代码,没有爬虫。用到的接口:文章列表、文章全文、按名字找公众号。
  • 只取公开发布的文章。导出的内容仅供个人研究和资料整理;转载或商用,请先取得原作者授权。
  • 问题和建议提 issue,或写信到 support@dataxapi.com。MIT 许可证。

English

Export a WeChat Official Account's past articles to Markdown files and a CSV index, by account name or gh_ ID. No QR login, no admin account, no cookies. One Python 3.9+ script with no dependencies; it prints the most a run can cost and calls nothing until you add --yes. Each call is $0.02 and failed calls are free; articles already saved in full are not fetched again. Needs a DataXAPI key in DATAXAPI_API_KEY. Unofficial; public articles only, for personal research.

About

公众号历史文章批量导出成 Markdown 和 CSV,不用扫码、不用后台、不用 Cookie / Export WeChat Official Account articles to Markdown and CSV, no login

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages