# WeChat Account Articles Scraper — 公众号文章列表 + 翻页 (`opspilot.cc/wechat-account-articles-scraper`) Actor

EN — Fetch a paginated article list from a WeChat Official Account by username: title, digest, cover, content url, create\_time. Auto-paginates using base64 next\_offset up to maxPages. Free users: 5 runs/day. ZH — 公众号文章列表抓取:标题/摘要/封面/正文链接/发布时间。支持 base64 cursor 翻页, 单次最多 maxPages 页。

- **URL**: https://apify.com/opspilot.cc/wechat-account-articles-scraper.md
- **Developed by:** [wang wei](https://apify.com/opspilot.cc) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.06 / actor start

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 Account Articles Scraper

EN — Fetch a paginated article list from any WeChat Official Account (公众号). Returns title, digest, cover, content URL and create\_time for every article. Supports auto-pagination using the upstream base64 `next_offset` cursor, with a configurable page cap.

ZH — 抓取任意微信公众号的文章列表。返回标题、摘要、封面、正文链接、发布时间。支持 base64 `next_offset` cursor 自动翻页,翻页页数可配置。

***

### When to use this Actor

| Goal | Actor |
|---|---|
| Read a single article's full body + metrics | [WeChat Article Detail Scraper](https://console.apify.com/actors/5vrr8dBcnclIva0Lx) |
| Read a public account profile (nickName, IP region, original article count) | [WeChat Account Profile Scraper](https://console.apify.com/actors/3JV499ECEjb5un854) |
| **List every article on a public account (this Actor)** | — |
| Search across all of WeChat (universal search) | [WeChat Universal Search Scraper](https://console.apify.com/actors/search) |

***

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `username` | string | `gh_114e76fd6e5d` | Three forms: `gh_<hex>`, `gh_<hex>@app`, or a custom micro-signal (e.g. `nikejdi`). |
| `maxPages` | int | `1` | Auto-pagination cap (1–50). Stops early when upstream returns `is_end=1`. |
| `itemsPerPage` | int | `20` | Page size hint forwarded to upstream. NOTE: WeChat currently ignores this — actual count is decided by the account itself. |
| `itemShowType` | string | `"0"` | `0` = articles (default), `5` = videos, `7` = audios, `8` = image-text posts. Empty string falls back to default. |
| `raw` | string | `"false"` | `false` = omit raw upstream payload (smaller dataset); `true` = attach `rawData[]` (one entry per page). |

#### How to find the `username`

You usually get a `username` from an article URL. The `user_name` is the `__biz` query parameter in any `https://mp.weixin.qq.com/s/...` link. For example:

```
https://mp.weixin.qq.com/s?__biz=MzIzNjc1NzUzMw==&mid=2247923517&idx=1&sn=...
                                       ^^^^^^^^^^^^^^^^^^^^^^
                                       this base64 decodes to the gh_<hex> form
```

Or use the [WeChat Article Detail Scraper](https://console.apify.com/actors/5vrr8dBcnclIva0Lx) — the output's `userName` field is exactly the value you pass into this Actor.

***

### Output (one row per Actor run)

```json
{
  "username": "gh_114e76fd6e5d",
  "bizUsername": "gh_114e76fd6e5d",
  "hasMore": false,
  "nextOffset": "",
  "totalFetched": 23,
  "pagesFetched": 2,
  "itemShowType": 0,
  "articles": [
    {
      "articleId": "2247923517",
      "idx": 1,
      "title": "被英伟达点名的杭州团队，补上了AI for Science的「最后一公里」",
      "digest": "从想法到结果，一次对话实现",
      "url": "http://mp.weixin.qq.com/s?__biz=...&mid=2247923517&idx=1&sn=...",
      "cover": "https://mmbiz.qpic.cn/.../640?wxtype=jpeg",
      "covers": {
        "ratio16_9": "https://mmbiz.qpic.cn/.../640?wxtype=jpeg",
        "ratio1_1": "https://mmbiz.qpic.cn/.../300?wxtype=jpeg",
        "ratio235_1": "https://mmbiz.qpic.cn/.../300?wxtype=jpeg",
        "ratio3_4": "https://mmbiz.qpic.cn/.../540?wxtype=jpeg"
      },
      "createTime": 1789519199,
      "updateTime": 1789526559,
      "isPaid": 0,
      "isPaySubscribe": 0,
      "itemShowType": 0,
      "itemShowTypeLabel": "article",
      "msgType": 9,
      "picCount": 0,
      "sourceUrl": null
    }
  ],
  "collectedAt": "2026-09-16T12:00:00.000Z"
}
```

**Field notes**

- `articleId` is emitted as a string (per §98 / large integer precision).
- `createTime` / `updateTime` are Unix epoch seconds.
- `covers` includes 16:9, 1:1, 235:1 and 3:4 aspect variants from upstream; pick the one that matches your layout.
- `hasMore=false` and `nextOffset=""` means the upstream has no more articles; the Actor stopped automatically.
- When `raw=true`, each `rawData[i]` is the upstream `data` object for page `i+1`.

***

### How to run

1. **Console**: paste any `gh_…` username (or use the default `gh_114e76fd6e5d`) and click Start.
2. **API**: `apify call wechat-account-articles-scraper -i '{"username":"gh_114e76fd6e5d","maxPages":2}'`
3. **Schedules**: schedule once per day per account to monitor new posts.

Free users: 5 runs/day. Paid users: charged 1 PPE event per page fetched (`account-articles-result`).

***

### Use it together with the other WeChat Actors

| Where in the pipeline | Actor | Console | Use it to |
|---:|---|---|---|
| step ① profile | [Account Profile Scraper](https://console.apify.com/actors/3JV499ECEjb5un854) | …/3JV499ECEjb5un854 | step ① — fetch the account identity + service type before listing its articles |
| **step ② listing** (you are here) | **Account Articles Scraper** | …/actor | **step ② — list every article published by a given account** |
| step ③ detail | [Article Detail Scraper](https://console.apify.com/actors/5vrr8dBcnclIva0Lx) | …/5vrr8dBcnclIva0Lx | step ③ — pull the full body + author + publish time for each article URL |
| search-first | [Universal Search Scraper](https://console.apify.com/actors/search) | …/search | sister Actor — discover accounts by keyword, then feed their `userName` back into this Actor |

**You are here:** **Account Articles Scraper** (step ②) — run it to inventory everything an account has published.

***

### Pricing

Charged once per upstream page fetched. Auto-pagination is transparent — `maxPages=10` means 10 PPE events. Stopping early on `is_end=1` does not charge the unused budget.

***

### Tests

```bash
npm test
```

Runs unit assertions (input validation, body shape, normalize across `raw=true` / `raw=false`, simplified / raw article shapes, multi-page aggregation) plus 9 integration scenarios (mock fetch drives the full `run()` flow including pagination, free-tier gating, upstream errors).

```
✅ unit.js: all assertions passed.
integration.js: 9 scenarios passed.
```

# Changelog

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

# Actor input Schema

## `username` (type: `string`):

WeChat account username. Three forms supported: `gh_<hex>` (e.g. gh\_114e76fd6e5d), `gh_<hex>@app` (linked mini-program account), or a custom micro-signal ID (e.g. nikejdi, rmrbwx). Exactly 1 per run.

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

Maximum number of upstream pages to fetch in one Actor run. Each page returns up to ~10 articles. Pagination stops early when the upstream returns is\_end=1. Min 1, max 50.

## `itemsPerPage` (type: `integer`):

Forwarded to upstream as page\_size. NOTE: WeChat currently ignores this parameter — the actual count per page is decided by the account itself. Default 20, max 100.

## `itemShowType` (type: `string`):

0 = articles (default), 5 = videos, 7 = audios, 8 = image-text posts. Empty string falls back to default (articles).

## `raw` (type: `string`):

Add the unprocessed upstream data object as rawData on the pushed item. Default false keeps datasets small; turn on for debugging or downstream pipelines that need the raw response.

## Actor input object example

```json
{
  "username": "gh_114e76fd6e5d",
  "maxPages": 1,
  "itemsPerPage": 20,
  "itemShowType": "0",
  "raw": "false"
}
```

# Actor output Schema

## `results` (type: `string`):

Each pushed item contains aggregated article list for one account (up to maxPages pages).

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

Account username, pages fetched, total article count, tier.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("opspilot.cc/wechat-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("opspilot.cc/wechat-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 '{}' |
apify call opspilot.cc/wechat-account-articles-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,opspilot.cc/wechat-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/vxAjW6anQJQWk7xTF/builds/DRbSN2Hg6TLSEMW73/openapi.json
