# 公眾號怎麼用 RSS 訂閱？

> 微信不提供 RSS。用公眾號的文章列表生成一個標準 RSS 源，放在任何地方，用任何閱讀器訂閱。費用和程式碼。

網頁版：https://okdata.online/zh-hant/answers/wechat-official-account-rss-feed/

**簡短回答：**微信沒有 RSS，只能自己生成：呼叫公眾號歷史文章介面（每次 $0.02，返回最新 10 篇），把結果寫成 RSS 檔案讓閱讀器去拉。一個號每天重新整理兩次，每月 $1.20；二十個號是 $24.00。

別的訂閱都在 Reeder、Inoreader 或 Folo 裡看，唯獨關心的那幾個公眾號只能在微信裡刷。微信從來沒提供過 RSS，所以訂閱源得自己生成。真正需要資料的部分很小：[公眾號歷史文章](/zh/apis/wechat_mp/accounts/articles/list/)返回一個號最新的 10 篇文章，帶標題、連結、摘要和釋出時間，正好一一對應 RSS 的 item。指令碼把它寫進 `feed.xml`，閱讀器像訂閱普通網站一樣去拉這個檔案。

## 步驟

1. 用[公眾號搜尋](/zh/apis/wechat_mp/accounts/search/)查一次這個號的原始 ID（gh_ 開頭），每返回一個號 $0.058。
2. 定時跑下面的指令碼，用 cron、GitHub Actions 或者一臺小伺服器都行。
3. 把 `feed.xml` 放到閱讀器訪問得到的地方：靜態託管、物件儲存，閱讀器裝在同一臺機器上的話放本地資料夾也可以。

```python
import os, requests
from email.utils import format_datetime
from datetime import datetime
from xml.sax.saxutils import escape

API = "https://api.okdata.online"
H = {"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"}
GH = "gh_363b924965e9"

body = requests.get(API + "/v1/wechat_mp/accounts/articles/list", headers=H,
                    params={"id": GH}, timeout=60).json()
if body["code"] != "ok":
    raise SystemExit(f"{body['code']}: {body['message']}")

items, name = [], GH
for a in body["data"]["items"]:
    name = a["author"]["name"] or name
    date = format_datetime(datetime.fromisoformat(a["published_at"].replace("Z", "+00:00")))
    items.append(f"<item><title>{escape(a['title'] or '')}</title><link>{escape(a['url'])}</link>"
                 f"<guid>{escape(a['url'])}</guid><pubDate>{date}</pubDate>"
                 f"<description>{escape(a['text'])}</description></item>")

rss = (f'<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel>'
       f"<title>{escape(name)}</title><link>https://mp.weixin.qq.com/</link>"
       f"<description>{escape(name)}（okdata 生成）</description>{''.join(items)}</channel></rss>")
open("feed.xml", "w", encoding="utf-8").write(rss)
```

## 多久重新整理一次，要花多少

每重新整理一次，每個號就是一次呼叫，不管有沒有新文章。

| 訂閱數 | 每天重新整理 | 每月呼叫 | 每月費用 |
|---|---|---|---|
| 1 | 2 次 | 60 | $1.20 |
| 20 | 2 次 | 1,200 | $24.00 |
| 20 | 6 次 | 3,600 | $72.00 |

搜尋時加 `view=full`，每個號都會帶 `ext.articles_per_week`（每週發文數）。一週發兩次的號用不著一天刷六次，刷一次就夠了。

## 限制

- item 的描述是文章摘要，不是全文。想在閱讀器裡看全文，每篇新文章多調一次[公眾號文章詳情](/zh/apis/wechat_mp/articles/get/)，每篇 $0.02，記得快取，同一篇別取兩次。
- 只有公開發布的文章。刪掉的文章下次重新整理就沒了，但閱讀器裡已經拉到的還在。
- 某次重新整理失敗的話，保留舊的 `feed.xml`，別用空檔案覆蓋。請求到了平台的失敗呼叫也照常計費。

## 免費的辦法

wewe-rss、we-mp-rss 這類自部署專案也能生成公眾號 RSS，不花錢，代價是要一直保持一個微信讀書帳號或公眾號後臺的登入。RSSHub 也有過公眾號相關的路由，用之前先確認對你關注的號還管用。自己看的幾個訂閱，用這些專案很合適；別人或者別的系統要依賴的訂閱源，走 API 更穩。各介面價格見[價格頁](/zh/pricing/)。

## 直接用開源倉庫

我們開源了 [wechat-rss](https://github.com/okdataapi/wechat-rss)：fork 之後在列表裡寫上公眾號，GitHub Actions 每天定時更新，GitHub Pages 釋出 RSS 和 Atom 訂閱地址，不用掃碼，也不用自己的伺服器。

## 用到的介面

- [公眾號歷史文章](https://okdata.online/zh/apis/wechat_mp/accounts/articles/list/) `wechat_mp.accounts.articles.list`：$0.02/次 · 每頁約 10 篇文章
- [公眾號搜尋](https://okdata.online/zh/apis/wechat_mp/accounts/search/) `wechat_mp.accounts.search`：$0.058/條 · 每次最多 $0.58

## 更多微信公眾號內容

- [微信公眾號 API](https://okdata.online/zh/apis/wechat_mp/)
- [公眾號 API Python 教程：把文章轉成 Markdown 給 RAG 用（2026）](https://okdata.online/zh/guides/wechat-official-account-api-python/)
- [怎麼拿到一個公眾號的歷史文章和全文](https://okdata.online/zh/guides/wechat-official-account-articles/)
- [公眾號怎麼用 RSS 訂閱？](https://okdata.online/zh/answers/wechat-official-account-rss-feed/)
- [公眾號文章資料 API 多少錢？](https://okdata.online/zh/answers/wechat-official-account-api-price/)
- [為什麼 ChatGPT、Claude 打不開公眾號文章連結？怎麼讓 AI 讀到全文？](https://okdata.online/zh/answers/ai-read-wechat-article-link/)
- [怎麼不登入匯出一個公眾號的全部歷史文章？](https://okdata.online/zh/answers/export-wechat-official-account-articles/)
- [怎麼查一個公眾號的 biz 和原始 ID（gh_ 開頭）？](https://okdata.online/zh/answers/find-wechat-official-account-id/)
- [想在公眾號投放廣告，怎麼找到某個領域的號？](https://okdata.online/zh/answers/find-wechat-official-accounts-by-topic/)
- [平台官方 API 和第三方資料介面怎麼選（2026）](https://okdata.online/zh/compare/official-apis-vs-data-apis/)
- [社媒資料 MCP 伺服器：自己部署還是用託管的](https://okdata.online/zh/compare/social-media-data-mcp-servers/)
- [公眾號文章和閱讀數介面有哪些？官方介面、第三方 API、開源工具、資料平台 4 類方案怎麼選（2026）](https://okdata.online/zh/compare/wechat-article-data-apis/)
- [獲取微信公眾號資料的幾種辦法：官方介面、RSS 橋接和資料介面](https://okdata.online/zh/compare/wechat-official-account-data-apis/)
- [讓 AI 讀小紅書、抖音、公眾號的 MCP 有哪些？開源自部署、瀏覽器自動化、託管 3 類怎麼選（Claude、Cursor、豆包）](https://okdata.online/zh/compare/xiaohongshu-douyin-wechat-mcp-servers/)

## 資料來源

這個問題出現過的地方（讀取於 2026-11-12）：

- https://github.com/DIYgod/RSSHub/issues/64
- https://github.com/cooderl/wewe-rss/issues/252

更新於 2026-11-29
