# WeChat Official Account Scraper: Articles, Reads & Comments (`rowfinch/wechat-official-account-scraper`) Actor

Read WeChat official accounts by WeChat ID and articles by link: an account's article history, today's articles, profile, original article count, each article's text, reads and likes, its comments and their replies. No login.

- **URL**: https://apify.com/rowfinch/wechat-official-account-scraper.md
- **Developed by:** [Rowfinch](https://apify.com/rowfinch) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 98.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 account articles

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 Scraper

Read WeChat official accounts (公众号) by their WeChat ID or by a link to one of their articles: the article history, today's pushes, each article's full text and its reads and likes, the account profile and its original article count, and the comments and replies under each article. No login or cookies.

**$3 per 1,000 articles, $1.50 per 1,000 comments, $0.05 per run.**

### What it's for

- **Competitor and media monitoring**: what an account published, when, and how its articles did.
- **Content research**: the full text and the metrics of articles on a topic you already know the links to.
- **Comment analysis**: what readers say under an article, with the replies in their threads.
- **Account due diligence**: profile, original article count and recent pushes before you work with an account.

Keyword search and lookup by display name aren't offered: give the account's WeChat ID or the link of one of its articles.

### Input

| Field         | What it does                                                                                                                                                                                  |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `operation`   | What to read (default `accountHistoryArticles`). See the operations below                                                                                                                     |
| `accounts`    | WeChat IDs (`rmrbwx`) or gh\_ IDs (`gh_363b924965e9`), one per line                                                                                                                            |
| `articleUrls` | Article links (`https://mp.weixin.qq.com/s/…`), one per line                                                                                                                                  |
| `maxPages`    | Pages to read per account or article, 1 to 50 (default 1). A page is 10 pushes of history or 20 comments. For comment replies, it is how many comments per article get all their replies read |

#### Operations

| Operation                | Reads                                                               | Input       |
| ------------------------ | ------------------------------------------------------------------- | ----------- |
| `accountHistoryArticles` | Articles an account has pushed, newest first                        | accounts    |
| `accountTodayArticles`   | Articles pushed today (China time)                                  | accounts    |
| `accountBasicInfo`       | Name, ID and profile of an account                                  | accounts    |
| `accountOriginalCount`   | How many original articles an account has                           | accounts    |
| `articleDetail`          | The full text, author, publish time and original flag of an article | articleUrls |
| `articleMetrics`         | An article's reads, likes, comments, shares and collects            | articleUrls |
| `articleComments`        | The comments under an article                                       | articleUrls |
| `articleCommentReplies`  | The replies under the first 20 comments of an article               | articleUrls |

Each entry is read once. An account or article WeChat can't find gets one row with the reason, and it isn't charged.

### Output

Every row has `operation` and `queryTarget`, the entry as you gave it. Then:

- **Articles** (history, today, detail): `articleUrl`, `title`, `digest`, `accountUserName`, `publishTime` (ISO), `publishTimestamp` (unix seconds), `coverUrl`. History rows add `read_num`, the raw `showDesc` and `statInfo`. Detail rows add `author`, `contentText`, `contentHtml`, `isOriginal`, `images`.
- **Metrics**: `articleUrl`, `read_num`, `like_count`, `old_like_count`, `share_count`, `comment_count`, `collect_count`, `star_num`.
- **Accounts**: `userName`, `nickName`, `aliasName`, `originalArticleCount`, `originalContentStr`.
- **Comments**: `articleUrl`, the comment fields, `replyTotalCount`.
- **Replies**: `articleUrl`, `parentContentId`, `parentNick`, the reply fields.

### Price

You pay per result, plus $0.05 when a run starts.

| Result                                   | Free and Starter | Scale and Business |
| ---------------------------------------- | ---------------- | ------------------ |
| Article (history or today)               | $3 per 1,000     | $2.50 per 1,000    |
| Article detail                           | $22 per 1,000    | $20 per 1,000      |
| Article metrics                          | $22 per 1,000    | $20 per 1,000      |
| Account info (profile or original count) | $22 per 1,000    | $20 per 1,000      |
| Comment                                  | $1.50 per 1,000  | $1.25 per 1,000    |
| Reply                                    | $10 per 1,000    | $8 per 1,000       |
| Run start                                | $0.05            | $0.05              |

Missing accounts and invalid article links aren't charged as results.

A run stops at the maximum cost you set for it. On Apify's free plan, a run returns up to 25 results. The free plan includes 5 runs of this actor a month.

For example, the last 3 pages of one account's history (about 30 articles) cost about $0.14, and the
full text of 100 articles costs about $2.25.

### FAQ

**Why is a row missing?** WeChat doesn't return every article or comment it has. The run keeps what it could read.

**Why is `accountName` empty in history rows?** WeChat's history list doesn't include the account's display name. Use `accountBasicInfo` for it.

# Actor input Schema

## `operation` (type: `string`):

Accounts are read by the operations for accounts, articles by the others.

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

WeChat IDs (rmrbwx), gh\_ IDs, or links to one of the account's articles, one per line.

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

Links like https://mp.weixin.qq.com/s/…, one per line.

## `maxPages` (type: `integer`):

History pages hold 10 pushes each; comment pages hold 20 comments. For comment replies, how many comments per article get all their replies read.

## Actor input object example

```json
{
  "operation": "accountHistoryArticles",
  "accounts": [
    "rmrbwx"
  ],
  "maxPages": 1
}
```

# Actor output Schema

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

No description

## `articles` (type: `string`):

No description

## `accounts` (type: `string`):

No description

## `comments` (type: `string`):

No description

# 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 = {
    "operation": "accountHistoryArticles",
    "accounts": [
        "rmrbwx"
    ],
    "maxPages": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("rowfinch/wechat-official-account-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 = {
    "operation": "accountHistoryArticles",
    "accounts": ["rmrbwx"],
    "maxPages": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("rowfinch/wechat-official-account-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 '{
  "operation": "accountHistoryArticles",
  "accounts": [
    "rmrbwx"
  ],
  "maxPages": 1
}' |
apify call rowfinch/wechat-official-account-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rowfinch/wechat-official-account-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/vK6huDiUihZSGVvsh/builds/fKuB2FW9Br03v9qgq/openapi.json
