# WeChat Article Scraper: Official Account (公众号) Full Text (`wheaten_steelpan/wechat-article-scraper`) Actor

Search WeChat Official Account (微信公众号) articles by keyword, or paste article links, and get title, account, author, publish time, images and full text (文章全文). No login. Pay only for articles returned with status ok; deleted and failed posts are free.

- **URL**: https://apify.com/wheaten_steelpan/wechat-article-scraper.md
- **Developed by:** [Vanja V](https://apify.com/wheaten_steelpan) (community)
- **Categories:** Social media, News
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 articles

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Article Scraper: Official Account (公众号) Full Text

Search WeChat Official Account (微信公众号) articles by keyword, or paste article links you already
have, and get one row per article: title, account, author, publish time, cover and images, and the
full article text (文章全文).

**You pay $0.004 per article returned with status `ok`.** There is no start fee, and proxy and
compute costs are included. Deleted posts, moved accounts, broken links and articles that showed a
verification page come back with the reason in their row and cost nothing.

You need no WeChat account, no login and no cookies.

![Output rows from a real run: keyword, title, account, publish date, status, layout, text length, article text, and the reason a row was not charged](https://api.apify.com/v2/key-value-stores/rehgfPT1Felqmzliu/records/output-example.png)

### What people use it for

- **WeChat article scraper.** Collect 公众号 articles on a topic, with full text, for research,
  media monitoring or a Chinese-language dataset.
- **Track what accounts publish on a subject.** Search a keyword with `timeRange` set to the past
  day or week.
- **Get the text of links you already have.** Paste `mp.weixin.qq.com` links and get title,
  account, date and text for each.

### What you pay for

**$0.004 per article** ($4 per 1,000), whatever its length, with or without full text.

| outcome | `status` | charged |
|---|---|---|
| the article was read | `ok` | **yes**, once per article |
| deleted by the publisher or blocked for everyone | `deleted` | no |
| the account moved to a new account (该公众号已迁移) | `migrated` | no |
| the link is broken or made up (参数错误) | `not_found` | no |
| WeChat or the search showed a verification page | `blocked` | no |
| any other page the Actor could not read | `failed` | no |

Rows that fail after the search keep what the search returned (title, account, publish time,
summary, link), so you still see which article it was. Every row that is not `ok` has an `error`
field with the reason. If you set a maximum cost per run, the Actor stops charging at that limit.

### Measured results

On a platform run of 20 Chinese keywords at 10 articles each plus 5 known links (205 rows, about
8 minutes):

- 166 of 191 articles found by search came back `ok` with text (86.9%).
- 25 rows (12%) were `blocked` because WeChat showed a verification page for the article. The
  Actor does not retry or charge these rows, and they keep their search fields.
- 3 rows were `deleted`, 6 `migrated`, 1 `not_found` (the made-up link) and 1 `failed`.
- The median article had 2,484 characters of text.

### What you get

One dataset row per article:

```json
{
  "keyword": "半导体",
  "rank": 4,
  "title": "半导体芯片遭遇“厕纸时刻”？",
  "summary": "西班牙《经济学家报》网站7月19日刊登题为《半导体芯片的“厕纸时刻”…",
  "accountName": "参考消息",
  "accountId": "gh_2837b93c1976",
  "accountBiz": "MjM5MzA0MTg2MA==",
  "author": "参考消息",
  "publishedAt": "2022-07-25T02:46:37.000Z",
  "publishedTs": 1658717197,
  "url": "https://mp.weixin.qq.com/s?src=11&timestamp=…",
  "permanentUrl": null,
  "coverImage": "https://mmbiz.qpic.cn/mmbiz_jpg/…",
  "images": ["https://mmbiz.qpic.cn/mmbiz_gif/…"],
  "isOriginal": true,
  "layout": "article",
  "text": "西班牙《经济学家报》网站7月19日刊登题为…",
  "textChars": 1278,
  "status": "ok",
  "error": null
}
```

- `layout` is `article`, `image_post`, `text_post` or `video_post`. Image posts and text posts get
  their caption in `text`.
- `accountId` is the account's WeChat id (usually `gh_…`) and `accountBiz` its `__biz` id, both
  read from the article page.
- `isOriginal` is `true` when WeChat marks the post as original content (原创).
- `url` is the link the search returned. `permanentUrl` is filled for links you give the Actor,
  and for a migrated post it holds the post's new address.
- `publishedAt` is ISO 8601 in UTC; `publishedTs` is the same moment as a Unix timestamp.

The run opens on an **Articles** table (status, keyword, rank, title, account, author, published,
link, text length, original, layout). The full JSON has everything.

### Input

| field | what it does |
|---|---|
| `keywords` | Search words, in Chinese or English. Each keyword is searched on its own. |
| `maxResultsPerKeyword` | Up to 25 per keyword (default 20). For more on a topic, add related keywords. |
| `timeRange` | `any`, `day`, `week`, `month` or `year`. Checked on every result page before any article is opened. |
| `publishedAfter` | Keep only articles published on or after this date (China time). |
| `articleUrls` | Article links you already have: `mp.weixin.qq.com/s/…` or `mp.weixin.qq.com/s?__biz=…`. One row each. |
| `includeFullText` | On (default): open each article for text, images, author and account id. Off: the search row only. Same price. |
| `proxyConfiguration` | Proxy for the search pages (residential by default). |

Articles that appear twice in one run (same account and title) are returned and charged once.

### How it works

The keyword search runs on Sogou's WeChat search (weixin.sogou.com), which indexes public 公众号
articles. Each article is then opened on mp.weixin.qq.com and read from the page. When the search
shows its verification page, the Actor stops that keyword and keeps the rows it already found; the
other keywords carry on. The run's `SUMMARY` record says which keywords stopped early.

### Use it from Make

The Actor works with the Apify modules in Make: run it, then read the dataset with "Get Dataset
Items". Every field has a fixed type (`rank` and `publishedTs` are numbers, `publishedAt` a date,
`images` an array, `isOriginal` a boolean), so you can map them directly.

### What this cannot do

- No read counts, likes or comments. WeChat shows those only to a signed-in reader.
- At most 25 articles per keyword. The search gives a limited number of results per visitor.
- No account or album (合集) listing in this version: search by keyword, or paste links.
- Articles behind a verification page come back `blocked` and are not retried.

### Pricing

| | |
|---|---|
| per article (`ok` row) | $0.004 |
| per 1,000 articles | $4.00 |
| start fee | none |
| proxy and compute | included |
| rows that are not `ok` | free |

### FAQ

**Do I need a WeChat account?**
No. The Actor reads public pages without signing in.

**Can I search in English?**
Yes, but most 公众号 articles are in Chinese, so Chinese keywords find far more.

**Why are some rows `blocked`?**
WeChat sometimes shows a verification page instead of the article. In our test run that happened
to 12% of rows. Those rows are free and keep the title, account and date from the search.

**How do I get more than 25 articles on a topic?**
Add related keywords. Each keyword returns up to 25 articles, and duplicates across keywords are
removed.

### Related Actors

- [Threads Scraper](https://apify.com/wheaten_steelpan/threads-scraper)
- [YouTube Transcript & Subtitles Scraper](https://apify.com/wheaten_steelpan/youtube-transcript-scraper)

# Actor input Schema

## `keywords` (type: `array`):

Search words, in Chinese or English. Each keyword is searched on its own; results come from WeChat Official Account (公众号) articles.

## `maxResultsPerKeyword` (type: `integer`):

Up to 25 per keyword. For more articles on a topic, add related keywords.

## `timeRange` (type: `string`):

Keep only articles published within this period before the run started. Checked on every result page, before any article is opened.

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

Keep only articles published on or after this date (China time).

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

WeChat article links you already have: mp.weixin.qq.com/s/... or mp.weixin.qq.com/s?\_\_biz=...\&sn=... Each link becomes one row.

## `includeFullText` (type: `boolean`):

Open each article and add its text, images, author, account id and original-content flag. Off: only the search result (title, account, date, summary, link). Same price either way.

## `proxyConfiguration` (type: `object`):

Proxy for the search and search-link pages. WeChat search answers residential IPs reliably. Article pages use Apify's datacenter proxy.

## Actor input object example

```json
{
  "keywords": [
    "人工智能"
  ],
  "maxResultsPerKeyword": 5,
  "timeRange": "any",
  "includeFullText": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

One row per article. Rows with status ok are charged; deleted, migrated, not found, blocked and failed rows are free.

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

Counts per status and, for each keyword, how many results were found, filtered by date or duplicated, and why a keyword stopped early.

# 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 = {
    "keywords": [
        "人工智能"
    ],
    "maxResultsPerKeyword": 5,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("wheaten_steelpan/wechat-article-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 = {
    "keywords": ["人工智能"],
    "maxResultsPerKeyword": 5,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("wheaten_steelpan/wechat-article-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 '{
  "keywords": [
    "人工智能"
  ],
  "maxResultsPerKeyword": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call wheaten_steelpan/wechat-article-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,wheaten_steelpan/wechat-article-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/f8cldtBBlZzFRbxiX/builds/5W7KD88OnqeX1zz07/openapi.json
