WeChat Official Account articles API in Python: history and reads (third-party, 2026)
WeChat's own Official Account API works only on your own account, and from July 2025 individual and unverified accounts lose even the list of published articles; there is no endpoint for reading another account. To read any account's articles and reads, use a third-party data API. Below it is done with DataXAPI's Python SDK; the free trial covers up to 333 calls. 3 endpoints do it: WeChat Official Account live search → WeChat Official Account articles → WeChat Official Account article stats. The worked example below is 34 calls and costs $0.68 in all; a failed call is not charged.
Find an account by name, take its last 3 pages of articles, then each article's reads, likes and shares, into one CSV.
Step 1: WeChat Official Account live search
Find the account by name in WeChat Search, closest first; id is its gh_ original ID.
curl -G "https://api.dataxapi.com/v1/wechat/accounts/search" \ --data-urlencode "query=36氪" \ -H "Authorization: Bearer $DATAXAPI_API_KEY"
# pip install dataxapi from dataxapi import DataXAPI dx = DataXAPI() # reads DATAXAPI_API_KEY result = dx.wechat.accounts.search(query="36氪") print(result["data"]["items"])
// npm i @dataxapi/sdk import { DataXAPI } from "@dataxapi/sdk"; const dx = new DataXAPI(); // reads DATAXAPI_API_KEY const result = await dx.wechat.accounts.search({ query: "36氪" }); console.log(result.data.items);
dataxapi call wechat.accounts.search 'query=36氪'{
"code": "ok",
"request_id": "86788fb5-4235-48ac-b9c6-23292e637c65",
"data": {
"items": [
{
"id": "1047168840907789",
"username": "nanfeng_0721",
"name": "南边的风",
"bio": "在上海,周末都在山里",
"avatar_url": "https://wx.qlogo.cn/mmhead/xjoBFsBvyPoDjvS4DO1qBnMkqIePSAETki44ma9I/132",
"verified": true
},
// … 10 more
]
},
"page": {
"next_cursor": "c1.Ew51uWdKdB0gdItoicfGl1FUa3rXNGNkJvKajjh3",
"cursor_expires_at": "2026-11-02T12:25:07.000Z",
"has_more": true,
"returned": 11
},
"warnings": [],
"meta": {
"capability": "wechat.accounts.search",
"result_status": "complete",
"fetched_at": "2026-11-02T11:25:07.000Z",
"cached": false,
"replayed": false,
"unavailable": {
"url": "platform",
"created_at": "capability",
"metrics": "capability"
},
"billing": {
"amount": "0.02",
"currency": "USD",
"balance_after": "9.98"
}
}
}From a response recorded 2026-11-02 11:25 UTC. Names, text and IDs are examples, and so are the links: none is the recorded one (the page shows no one's personal data); the figures are as recorded. Long lists are cut. The request ID, cursor and balance are made up.
WeChat Official Account live search · $0.0200 / a call · Parameters, fields and errors on the endpoint's page →
Step 2: WeChat Official Account articles
Put the original ID into id for a page of articles, newest first; the next page comes from page.next_cursor. Each item's url is the article's link.
curl -G "https://api.dataxapi.com/v1/wechat_mp/accounts/articles/list" \ --data-urlencode "id=gh_13c97ab93ce8" \ -H "Authorization: Bearer $DATAXAPI_API_KEY"
# pip install dataxapi from dataxapi import DataXAPI dx = DataXAPI() # reads DATAXAPI_API_KEY result = dx.wechat_mp.accounts.articles.list(id="gh_13c97ab93ce8") print(result["data"]["items"])
// npm i @dataxapi/sdk import { DataXAPI } from "@dataxapi/sdk"; const dx = new DataXAPI(); // reads DATAXAPI_API_KEY const result = await dx.wechat_mp.accounts.articles.list({ id: "gh_13c97ab93ce8" }); console.log(result.data.items);
dataxapi call wechat_mp.accounts.articles.list id=gh_13c97ab93ce8
{
"code": "ok",
"request_id": "882b7d3d-9a50-48d1-ba28-513bec440e40",
"data": {
"items": [
{
"id": "2651350693_1",
"url": "https://mp.weixin.qq.com/s/yEmemDFnwYkjLklz1HGeGz",
"type": "article",
"title": "实测一个月周末露营,结论有点意外",
"text": null,
"published_at": "2026-10-12T13:35:48.000Z",
"author": { "id": "gh_baa95f56a86c" }
},
// … 9 more
]
},
"page": {
"next_cursor": "c1.c3D9oI16A0J5E0SMD5JU_mAesJzXbexIUP2nOHbv",
"cursor_expires_at": "2026-10-12T20:02:58.000Z",
"has_more": true,
"returned": 10
},
"warnings": [],
"meta": {
"capability": "wechat_mp.accounts.articles.list",
"result_status": "complete",
"fetched_at": "2026-10-12T19:02:58.000Z",
"cached": false,
"replayed": false,
"unavailable": {
"lang": "capability",
"author.username": "capability",
"author.name": "capability",
"author.avatar_url": "capability",
"author.verified": "capability",
"author.followers": "capability",
"metrics": "capability",
"images": "capability",
"hashtags": "platform",
"mentions": "platform",
"is_pinned": "capability",
"post_id": "platform",
"parent_id": "platform",
"root_id": "platform"
},
"billing": {
"amount": "0.02",
"currency": "USD",
"balance_after": "9.98"
}
}
}From a response recorded 2026-10-12 19:02 UTC. Names, text and IDs are examples, and so are the links: none is the recorded one (the page shows no one's personal data); the figures are as recorded. Long lists are cut. The request ID, cursor and balance are made up.
WeChat Official Account articles · $0.0200 / a call · Parameters, fields and errors on the endpoint's page →
Step 3: WeChat Official Account article stats
Put the article's link into url for its reads, likes, recommendations, shares, saves and comments right now. It needs the long link.
curl -G "https://api.dataxapi.com/v1/wechat_mp/articles/metrics" \ --data-urlencode "url=https://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667038683&idx=1&sn=0422127e651acd7f6cf6ef7e1cff04bc" \ -H "Authorization: Bearer $DATAXAPI_API_KEY"
# pip install dataxapi from dataxapi import DataXAPI dx = DataXAPI() # reads DATAXAPI_API_KEY result = dx.wechat_mp.articles.metrics(url="https://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667038683&idx=1&sn=0422127e651acd7f6cf6ef7e1cff04bc") print(result["data"]["item"])
// npm i @dataxapi/sdk import { DataXAPI } from "@dataxapi/sdk"; const dx = new DataXAPI(); // reads DATAXAPI_API_KEY const result = await dx.wechat_mp.articles.metrics({ url: "https://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667038683&idx=1&sn=0422127e651acd7f6cf6ef7e1cff04bc" }); console.log(result.data.item);
dataxapi call wechat_mp.articles.metrics 'url=https://mp.weixin.qq.com/s?__biz=MjM5MjAxNDM4MA==&mid=2667038683&idx=1&sn=0422127e651acd7f6cf6ef7e1cff04bc'{
"code": "ok",
"request_id": "789c698d-e1c1-4558-9aa5-408482ee5894",
"data": {
"item": {
"id": "2622051355_1",
"metrics": {
"likes": 2235,
"comments": 6,
"shares": 9041,
"favorites": 97,
"views": 100001
},
"approximate": [
{ "field": "metrics.views", "kind": "lower_bound" }
]
}
},
"warnings": [],
"meta": {
"capability": "wechat_mp.articles.metrics",
"result_status": "complete",
"fetched_at": "2026-10-29T09:44:39.000Z",
"cached": false,
"replayed": false,
"unavailable": {
"url": "capability",
"type": "capability",
"title": "capability",
"text": "capability",
"lang": "capability",
"published_at": "capability",
"author": "capability",
"metrics.reposts": "platform",
"images": "capability",
"hashtags": "capability",
"mentions": "capability",
"is_pinned": "capability",
"post_id": "platform",
"parent_id": "platform",
"root_id": "platform"
},
"billing": {
"amount": "0.02",
"currency": "USD",
"balance_after": "9.98"
}
}
}From a response recorded 2026-10-29 09:44 UTC. Names, text and IDs are examples, and so are the links: none is the recorded one (the page shows no one's personal data); the figures are as recorded. Long lists are cut. The request ID, cursor and balance are made up.
WeChat Official Account article stats · $0.0200 / a call · Parameters, fields and errors on the endpoint's page →
What the example costs
One account search, 3 pages of articles, then the counts of 30 articles
Prices are the prices in force when this page was built. A failed call costs nothing.
In your AI (MCP)
Connect DataXAPI to your AI client once. Then say what you want; the agent finds these endpoints, checks the price and calls them on your balance.
{
"capability": "wechat.accounts.search",
"query": "36氪",
"idempotency_key": "<a new UUID>"
}Sign in to copy the setup prompt with your keyAbout the MCP server →
Why DataXAPI
- Steady: endpoints were available 99.9% of the last 30 days, on a public status page you can check.
- Fast: a paid call took 3.5 seconds at the median over the last 7 days (counted 2026-11-06).
- Fewer tokens: across 8 endpoints on WeChat Official Accounts, one recorded real response each, the platform's own JSON comes to 21k tokens and what an AI reads through DataXAPI's MCP server to 4,494, 79% fewer; the JSON of a direct API call is 70% fewer too (counted 2026-11-06). Every platform answers in one shape: the author in
author, counts inmetrics, the next page inpage.next_cursor, so another platform needs no new parser. - See before you pay: every endpoint's page shows a recorded real response, field by field.
- Spending you control: a failed call is not charged; each key can have a limit,
X-Max-Pricecaps one call, and the sameIdempotency-Keywithin 24 hours is never charged twice. - Ready for AI: a remote MCP server listed in the official MCP registry as
com.dataxapi/mcp, usable from Claude, Cursor and ChatGPT. - Free trial of up to 333 calls, no card.
Good to know
- No WeChat account, no QR login and no verified account of yours.
- The whole text comes from
wechat_mp.articles.getand featured comments fromwechat_mp.articles.comments.list, both by the article's link. - Without code: connect DataXAPI to Claude or ChatGPT and say the sentence under “In your AI”.
The whole script
The task above as one script that runs as it is: Python, the SDK, your key from DATAXAPI_API_KEY. It writes a CSV file and ends by printing what it called, fetched and was charged.
# pip install dataxapi # export DATAXAPI_API_KEY=dx_... (your key) import csv from decimal import Decimal from dataxapi import DataXAPI dx = DataXAPI() calls, fetched, charged = 0, 0, Decimal("0") def run(capability, params): """One call; counts it and what it was charged.""" global calls, charged result = dx.call(capability, params) calls += 1 charged += Decimal(str(result["meta"]["billing"]["amount"])) return result NAME = "人民日报" PAGES = 3 # 1. The account's original ID (gh_...), the closest match first. account = run("wechat.accounts.search", {"query": NAME})["data"]["items"][0]["id"] # 2. Its articles, newest first, page after page. articles, cursor = [], None for _ in range(PAGES): page = run("wechat_mp.accounts.articles.list", {"id": account, **({"cursor": cursor} if cursor else {})}) articles += page["data"]["items"] cursor = page["page"]["next_cursor"] if not page["page"]["has_more"]: break # 3. Each article's reads, likes and shares right now. rows = [] for article in articles: counts = run("wechat_mp.articles.metrics", {"url": article["url"]})["data"]["item"]["metrics"] rows.append([article.get("published_at"), article.get("title"), counts.get("views"), counts.get("likes"), counts.get("shares"), article.get("url")]) fetched = len(rows) with open("wechat-articles-reads.csv", "w", newline="", encoding="utf-8") as file: csv.writer(file).writerows([["published_at", "title", "reads", "likes", "shares", "url"], *rows]) print(f"calls: {calls}, items: {fetched}, charged: ${charged}")