# WeChat Official Account Articles Scraper (`automation-lab/wechat-official-account-articles-scraper`) Actor

Collect the public article history of WeChat Official Accounts (公众号): album (合集) articles newest first plus Sogou-indexed articles, with full text, author, images and an only-new checkpoint for scheduled monitoring.

- **URL**: https://apify.com/automation-lab/wechat-official-account-articles-scraper.md
- **Developed by:** [Automation Lab](https://apify.com/automation-lab) (community)
- **Categories:** Social media, News
- **Security:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 83.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.88 / 1,000 article with full texts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## WeChat Official Account Articles Scraper

Collect the public article history of the WeChat Official Accounts (微信公众号) you follow: every article in the account's public albums (合集), newest first, plus the account's articles in Sogou's public WeChat index, each with the full text, author, publish time, images and account details. Turn on the checkpoint and scheduled runs return only articles you have not received yet.

No WeChat login, no cookies, no app and no third-party data API.

### What does WeChat Official Account Articles Scraper do?

You give it accounts. It gives you their articles.

- 📚 **Account history from albums.** Reads every public album (合集) of the account through WeChat's own album pages, newest first, with permanent article links. Long albums are followed page by page.
- 🔎 **Sogou-indexed articles.** Searches Sogou's public WeChat index for the account name and keeps only articles published by that exact account. This also finds articles that are not in any album.
- 📄 **Full article text.** Reads each article page for the body text (with paragraph breaks), optional body HTML, every in-article image, author, publish location (发表于), cover, digest and the account's `gh_` id and avatar.
- 🔁 **Only new articles.** A checkpoint per account remembers what was delivered. The next run skips those articles and, when there is room, continues further back into album history.
- 🔗 **Article links.** Paste `mp.weixin.qq.com` links to read single articles in full.

### Who is it for?

- **China media-monitoring teams** archiving new articles from a fixed list of brand, media and government accounts every day.
- **Market and competitor researchers** reading a competitor's or a category leader's recent publishing in full text.
- **Investment and industry analysts** following research and newsletter accounts (行研, 周报) and feeding them into a reading pipeline.
- **PR and communications teams** keeping a dated record of what an account published and when.
- **Data and AI teams** building Chinese-language corpora or RAG indexes from known publishers, with stable article keys for deduplication.

### Why use this WeChat article history scraper?

- **History, not just search.** Most WeChat tools are keyword search. This Actor starts from the account and walks its albums like a publishing archive.
- **Checkpointed monitoring.** `onlyNew` keeps one small record per account in your own key-value store. Daily schedules return only new posts; articles delivered before are skipped and cost nothing.
- **Normalized article bodies.** Clean text with paragraph breaks, optional cleaned HTML with real image URLs, and a character count, ready for search indexes and LLMs.
- **Permanent identity.** Every article whose page or album entry is read carries `articleKey` (`__biz_mid_idx`), which stays the same across runs even when a link is temporary. The one exception is listed under [Tips and limits](#tips-and-limits).
- **Honest coverage fields.** `source` tells you whether a row came from an album, the Sogou index or your link; `contentStatus` tells you whether the full text was read.

### What data can you extract from WeChat Official Accounts?

| Field | Description |
| --- | --- |
| `title` | Article title |
| `publishedAt` / `publishedTimestamp` | Publish time (ISO 8601 UTC / Unix seconds) |
| `accountName` | Official Account display name |
| `accountId` | Account `gh_` id |
| `accountBiz` | Account `__biz` id |
| `accountAvatarUrl` | Account avatar |
| `author` | Signed author (byline) |
| `digest` | Summary under the title |
| `contentText` | Full body text with paragraph breaks |
| `contentHtml` | Cleaned body HTML (optional) |
| `imageUrls` | Images in the article body |
| `wordCount` | Non-space characters in the body |
| `coverImageUrl` | Cover image |
| `publishLocation` | 发表于 province or country |
| `albumId` / `albumTitle` | Album (合集) of the article |
| `articleUrl` | Article link |
| `articleUrlIsPermanent` | Whether the link keeps working |
| `articleKey`, `messageId`, `indexInMessage` | Permanent article identity (`null` only for Sogou-only rows whose page was not read: full text off, or the page was blocked or unreadable) |
| `source` | `album`, `sogou` or `article_url` |
| `contentStatus` | `ok`, `not_requested`, `blocked` or `unavailable` |
| `inputAccount`, `collectedAt` | Which input produced the row, and when |

Read counts, likes, comments and other figures that only the logged-in WeChat app shows are **not** included.

### How much does it cost to scrape WeChat Official Account articles?

This Actor uses pay-per-event pricing. You pay a small start fee per run and then per saved article. Prices per article fall on higher Apify plans:

| Event | Free | Bronze | Silver | Gold and above |
| --- | --- | --- | --- | --- |
| Run start (once per run) | $0.005 | $0.005 | $0.005 | $0.005 |
| Article with full text | $0.00552 | $0.0048 | $0.003744 | $0.00288 |
| Article metadata (no full text) | $0.003105 | $0.0027 | $0.002106 | $0.00162 |

"Article with full text" covers one saved article with its full text, author, images and account details. "Article metadata" covers one saved article without full text: title, date, link and cover, when full text is off or the page could not be read.

Examples on the Free plan:

- 20 articles with full text from one account: $0.005 + 20 × $0.00552 = **$0.115**
- 100 articles with full text from five accounts: $0.005 + 100 × $0.00552 = **$0.557**
- 500 album entries without full text: $0.005 + 500 × $0.003105 = **$1.558**

Duplicates, articles outside your date filter, articles skipped by the checkpoint and runs that stop on invalid input are free. Platform usage is included in these prices. Set a maximum cost per run in the run options to cap spending.

### How to scrape a WeChat Official Account's articles

1. Open the Actor and add accounts under **Official Accounts**: the exact display name (for example `刀法研究所`), a link to any one of its articles, or a link to one of its albums.
2. Set **Max articles per account** (default 20) and, if you only want recent posts, **Published after** (for example `30 days`).
3. Keep **Include full text** on for the article body, or turn it off for a cheaper list of titles, dates and links.
4. For daily monitoring, turn on **Only new articles** and save the input as a Task with a schedule.
5. Click **Start**, then export the dataset as JSON, CSV, Excel or through the API.

### Input parameters

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `accounts` | array of strings | `["刀法研究所"]` when the input is empty | Display names, article links or album links, one account each |
| `articleUrls` | array of strings | – | Single article links. `publishedAfter` and `includeContent` apply to them; `onlyNew` does not |
| `maxArticlesPerAccount` | integer | 20 | Most articles per account per run, newest first (1–2000) |
| `publishedAfter` | string | – | `YYYY-MM-DD` (China time) or a period such as `7 days`, `4 weeks`, `6 months` |
| `includeContent` | boolean | true | Read each article page for the full text |
| `includeHtml` | boolean | false | Also save cleaned body HTML |
| `onlyNew` | boolean | false | Skip articles delivered before; continue deeper on later runs |
| `stateStoreName` | string | `wechat-account-history` | Key-value store for the checkpoints |
| `sogouPages` | integer | 3 | Sogou index pages (10 results each) per account name; 0 turns it off |
| `maxAlbumsPerAccount` | integer | 10 | Most albums read per account |

#### Input examples

The latest 20 articles of an account, with full text:

```json
{ "accounts": ["刀法研究所"], "maxArticlesPerAccount": 20 }
```

Everything an account published in its albums in the last month, named by an article link:

```json
{
  "accounts": ["https://mp.weixin.qq.com/s/TSNQKkRpN1qbKsT7BvzqIw"],
  "publishedAfter": "30 days",
  "maxArticlesPerAccount": 200
}
```

Daily monitoring of several accounts (save as a Task and schedule it):

```json
{
  "accounts": ["刀法研究所", "新华社", "https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzU4Mjg3MDAyMQ==&action=getalbum&album_id=1350949855442862082"],
  "maxArticlesPerAccount": 30,
  "onlyNew": true,
  "stateStoreName": "my-daily-wechat-watch"
}
```

A whole album as a list of titles, dates and permanent links:

```json
{
  "accounts": ["https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzIzMDY1MTUxMQ==&action=getalbum&album_id=3346853368002052096"],
  "includeContent": false,
  "sogouPages": 0,
  "maxArticlesPerAccount": 500
}
```

### Output example

A real record from a run on 2026-11-02 (`contentText` shortened):

```json
{
  "articleKey": "MzU4Mjg3MDAyMQ==_2247638418_1",
  "articleUrl": "https://mp.weixin.qq.com/s?__biz=MzU4Mjg3MDAyMQ==&mid=2247638418&idx=1&sn=...&chksm=...",
  "articleUrlIsPermanent": true,
  "title": "我们最近买的 4 个「新玩意」",
  "digest": "...",
  "author": "少数派",
  "accountName": "少数派",
  "accountId": "gh_...",
  "accountBiz": "MzU4Mjg3MDAyMQ==",
  "messageId": "2247638418",
  "indexInMessage": 1,
  "publishedAt": "2026-11-01T...Z",
  "publishLocation": "广东",
  "coverImageUrl": "https://mmbiz.qpic.cn/...",
  "contentText": "...",
  "contentHtml": null,
  "imageUrls": ["https://mmbiz.qpic.cn/..."],
  "wordCount": 3120,
  "albumId": "1350949855442862082",
  "albumTitle": "少数派的「新玩意」",
  "source": "album",
  "inputAccount": "https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzU4Mjg3MDAyMQ==&action=getalbum&album_id=1350949855442862082",
  "contentStatus": "ok",
  "collectedAt": "2026-11-02T08:00:00.000Z"
}
```

Each run also writes a `SUMMARY` record to its key-value store: per-account counts (albums found, Sogou matches, articles saved) and request statistics.

### How the account history is found

WeChat has no public "all articles of an account" page outside the WeChat app. This Actor combines the two public sources that exist:

1. **Albums (合集).** Many accounts file their articles into albums. Album pages are public and list every article with a permanent link, newest first. The Actor finds an account's albums from its article pages and reads each album to the depth you need.
2. **Sogou's WeChat index.** Sogou indexes a sample of each account's articles. The Actor searches the account name and keeps only the articles whose account matches exactly.

Both sources are merged and sorted newest first before your limit is applied. Duplicates are removed by article identity (`articleKey`), not by title: two different articles are both kept even when their titles and publish times are identical. With full text on, a Sogou row's page is read first and its `articleKey` is compared; a title match alone never removes it. With full text off, Sogou rows whose page was already read to identify the account keep their `articleKey` and are compared the same way. Only a Sogou row whose id is unknown (full text off, or its page blocked or unreadable) falls back to matching by account, title and exact publish time; see Tips and limits.

### Tips and limits

- **Coverage depends on the account.** Accounts that use albums give a complete, ordered history for those albums. For accounts without albums, you get the Sogou-indexed sample: often the account's best-known articles rather than the newest, and roughly up to 100 per name. Check `source` on each row.
- **Name the account by a link when you can.** An article or album link identifies the account exactly. Display names must match the account's name exactly; names shared with many other accounts' article titles (for example a big newspaper) may find fewer matches.
- **`__biz` or `gh_` ids alone cannot be looked up** without the WeChat app. Paste a link to one of the account's articles instead.
- **Temporary links.** Articles found only through Sogou get a signed link that expires after some hours (`articleUrlIsPermanent: false`). Their full text is read in the same run, and `articleKey` stays stable.
- **Some Sogou-only rows have no `articleKey`.** A Sogou signed link does not contain the article id, so the id is known only after the page is read. When the page is not read (`includeContent` off, except the few newest rows read to identify the account) or cannot be read (`contentStatus: "blocked"` or `"unavailable"`), `articleKey`, `messageId` and `indexInMessage` are `null`. Such rows are deduplicated, and remembered by `onlyNew`, by account, title and exact publish time. This fallback is approximate: two different articles with the same title posted at the same second would be treated as one. It never overrides a known `articleKey`. Album rows always have `articleKey`. Keeping `includeContent` on gives a key to every Sogou row whose page opens.
- **Pasted article links** work in the short form (`https://mp.weixin.qq.com/s/<code>`) and in the long form with `chksm`. Long links without `chksm` are usually stopped by WeChat's verification page.
- **Blocked pages.** WeChat sometimes shows a verification page. The Actor retries from a fresh IP; if all attempts fail, the row is kept with `contentStatus: "blocked"` and charged at the metadata price.
- **Deleted or restricted articles** come back as `contentStatus: "unavailable"`.
- Image-only posts have an empty `contentText` and their pictures in `imageUrls`.

### Integrations

- **Daily archive to Google Sheets or a database.** Schedule a Task with `onlyNew` and send new rows to Google Sheets, Airtable or your warehouse through Apify integrations or webhooks.
- **Slack or email alerts.** Use the run-succeeded webhook to post new titles and links for a watch list of accounts.
- **Search and RAG.** Load `contentText`, `title`, `accountName` and `publishedAt` into a vector store; use `articleKey` as the document id so reruns update instead of duplicating.
- **Translation.** Pipe `contentText` into a translation step for non-Chinese-speaking teams.
- **Make, Zapier, n8n.** Start the Actor and read the dataset from any of these platforms.

### Use the API

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/automation-lab~wechat-official-account-articles-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"accounts":["刀法研究所"],"maxArticlesPerAccount":20}'
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/wechat-official-account-articles-scraper').call({
    accounts: ['刀法研究所'],
    maxArticlesPerAccount: 20,
    onlyNew: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((a) => `${a.publishedAt} ${a.accountName}: ${a.title}`));
```

#### Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("automation-lab/wechat-official-account-articles-scraper").call(
    run_input={"accounts": ["刀法研究所"], "maxArticlesPerAccount": 20}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["publishedAt"], item["accountName"], item["title"])
```

### Use with AI agents (MCP)

Add this Actor to Claude Code:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/wechat-official-account-articles-scraper"
```

Claude Desktop, Cursor or VS Code (JSON configuration):

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/wechat-official-account-articles-scraper"
    }
  }
}
```

Selecting the Actor also adds the run, dataset and key-value-store helper tools. Start the Actor once and keep the returned run ID. If the call returns before the run finishes, check that same run with `get-actor-run` using a short backoff (for example 2, 4, 8 seconds, capped at 10) up to a deadline you choose, such as 120 seconds. Do not start a new run just to poll.

When the run has succeeded, read results with `get-dataset-items`:

- **Request shape.** Pass the dataset ID, an explicit `limit` and `offset`, and only the `fields` you need, for example `title,accountName,publishedAt,articleUrl,articleKey`. Leave out `contentText` and `contentHtml` unless the task needs the article bodies.
- **Total budget.** Set both a row budget and a byte budget before you start, for example at most 100 rows and 60,000 bytes of serialized UTF-8 JSON in the model context. Page 20 rows at a time and stop at whichever budget is reached first.
- **Oversized pages.** A single full-text article can be 10–30 KB. If one page would go over the remaining byte budget, request it again with fewer rows (down to 1) or without `contentText`. Do not truncate a row silently.
- **Continuation.** Keep the next `offset` and the dataset's total item count. Tell the user how many rows you read out of how many, and that the rest can be read by continuing from that offset.
- **Large results.** For more rows than the budget allows, give the user a dataset export link (JSON, CSV or Excel) instead of pulling everything into the conversation.
- **Partial results.** If a run fails or is still pending at your deadline, report that with the run ID instead of presenting partial rows as complete. A run that stopped at its spending limit says so in its status message; report the row count as partial.

Example prompts:

- "Get the 10 newest articles from the WeChat account 刀法研究所 and summarize each in one sentence."
- "Which articles did 少数派 publish in the last 7 days? List titles and links."
- "Read this WeChat article link and translate the first paragraph into English."

### Is it legal to scrape WeChat Official Account articles?

This Actor reads only public pages: public album listings, Sogou's public search results and public article pages. It does not log in, does not use the WeChat app and does not access private messages, follower data or paid content. Articles are copyrighted by their publishers: use the data for research, monitoring and analysis, respect the publishers' rights when republishing, and follow the laws that apply to you, including China's Personal Information Protection Law when articles mention people. This Actor is not affiliated with Tencent, WeChat or Sogou.

### Data handling and diagnostics

Failed runs send sanitized diagnostic input, exceptions and Actor/build/run IDs to our private GlitchTip service so we can repair problems. Secret fields and URL queries are removed; reports are retained for 30 days. Raw WeChat and Sogou pages and Sogou cookies are not product output and are kept in memory only for the run. Checkpoints (when `onlyNew` is on) are stored in a key-value store in your own Apify account. Apify stores your dataset, input and logs under your account's retention settings; delete them in Console when no longer needed. The Actor does not use AI at runtime and does not send scraped data to any AI provider.

### FAQ

**Can I get every article an account ever published?**
Only what is public. Album articles are complete for each album. Articles outside albums come from Sogou's index, which holds a sample. The full private history list exists only inside the WeChat app.

**Why did my account name return nothing?**
The name must match the account's display name exactly, and Sogou must have indexed some of its articles. Paste a link to any article of the account instead: that works even when the name search does not.

**Why are some links marked as not permanent?**
Articles found only through Sogou come with a signed link that expires. The full text is read in the same run, so you keep the content; `articleKey` identifies the article permanently. With full text turned off, or when a page is blocked or unreadable, a Sogou-only row has no `articleKey`; see Tips and limits.

**How does "Only new articles" work with a limit?**
The first run delivers up to your limit, newest first. Later runs skip delivered articles, deliver new posts first and then continue further back in each album, so a series of runs walks the whole album history. An album is marked as finished only once every article in it has been delivered, so a limit that stops partway through the last listing page loses nothing. An article delivered once is never delivered or charged again for that account, even if a later run finds it through a different source.

Single article links (the article links field) are not checkpointed and are read on every run.

**Some rows say `contentStatus: "blocked"`. What happened?**
WeChat showed its verification page on every retry for that article. The row is kept with title, date and link, charged at the metadata price. Running again later usually reads it.

If such an article was found only through Sogou, its `articleKey` is `null`, because the article id is read from the page.

**Does it return read counts, likes or comments?**
No. Those numbers are shown only to logged-in WeChat app users.

### Related scrapers

- [Sogou WeChat Article Search Scraper](https://apify.com/automation-lab/sogou-wechat-article-search-scraper): keyword search across all WeChat Official Accounts through Sogou. Use it to discover accounts and topics, then follow the accounts here.

# Changelog

This Actor's version history is a separate document: https://apify.com/automation-lab/wechat-official-account-articles-scraper/changelog.md

# Actor input Schema

## `accounts` (type: `array`):

One account per line: the exact display name (e.g. 刀法研究所), a link to any one of its articles, or a link to one of its albums (合集, https://mp.weixin.qq.com/mp/appmsgalbum?\_\_biz=...\&album_id=...). An article or album link is the most reliable way to name an account. If neither accounts nor article links are given, the example account 刀法研究所 is used.

## `articleUrls` (type: `array`):

Optional mp.weixin.qq.com article links to read in full, in either form: https://mp.weixin.qq.com/s/<code> or https://mp.weixin.qq.com/s?\_\_biz=...\&mid=...\&idx=...\&sn=...\&chksm=.... Links without chksm are usually blocked by WeChat's verification page. 'Published after' and 'Full text' apply to these links too; 'Only new articles' does not, so they are read on every run.

## `maxArticlesPerAccount` (type: `integer`):

Most articles to save per account in this run, newest first. With 'Only new articles' on, the next run continues further back from where this one stopped.

## `publishedAfter` (type: `string`):

Skip articles published before this date. A date (2026-10-01, read as China time) or a period such as '7 days', '4 weeks', '6 months'.

## `includeContent` (type: `boolean`):

Read every article page for the full text, author, images and account details. Turn off to get title, date, link and cover only, at the lower metadata price.

## `includeHtml` (type: `boolean`):

Also save the cleaned article body HTML (images use their real URLs). Needs 'Include full text'.

## `onlyNew` (type: `boolean`):

Remember what each account already delivered, in a key-value store in your Apify account. Later runs skip those articles, so scheduled runs return only new posts, and continue deeper into album history when there is room.

## `stateStoreName` (type: `string`):

Name of the key-value store that holds the checkpoints when 'Only new articles' is on. Use different names for independent schedules.

## `sogouPages` (type: `integer`):

How many result pages (10 results each) of Sogou's public WeChat index to search for each account name. These pages find the account and articles outside its albums. 0 turns the Sogou search off (then name the account with an article or album link).

## `maxAlbumsPerAccount` (type: `integer`):

Most albums (合集) to read per account.

## Actor input object example

```json
{
  "accounts": [
    "刀法研究所"
  ],
  "maxArticlesPerAccount": 20,
  "includeContent": true,
  "includeHtml": false,
  "onlyNew": false,
  "stateStoreName": "wechat-account-history",
  "sogouPages": 3,
  "maxAlbumsPerAccount": 10
}
```

# Actor output Schema

## `overview` (type: `string`):

Table of saved articles: publish time, account, title, author, album, source and link.

## `fullText` (type: `string`):

Saved articles with digest, full body text and image URLs.

## `summary` (type: `string`):

Per-account counts (albums found, Sogou matches, articles saved) and request statistics for the run.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "accounts": [
        "刀法研究所"
    ],
    "maxArticlesPerAccount": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/wechat-official-account-articles-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "accounts": ["刀法研究所"],
    "maxArticlesPerAccount": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/wechat-official-account-articles-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "accounts": [
    "刀法研究所"
  ],
  "maxArticlesPerAccount": 20
}' |
apify call automation-lab/wechat-official-account-articles-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/wechat-official-account-articles-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/MrKgzFIYalUySHYpJ/builds/Da0Dbjg80oKQmfGgy/openapi.json
