# WeChat Official Account Scraper → Markdown 公众号 (`technicaldost/wechat-article-markdown-scraper`) Actor

Turn any WeChat Official Account (微信公众号) article into clean, RAG-ready Markdown with title, author, account name, publish time, cover and image URLs. No API key or WeChat account needed for article URLs; optional keyword discovery via Sogou WeChat search.

- **URL**: https://apify.com/technicaldost/wechat-article-markdown-scraper.md
- **Developed by:** [Technical Dost Solutions](https://apify.com/technicaldost) (community)
- **Categories:** AI, News
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## WeChat Official Account Scraper → Markdown 公众号

Convert any **WeChat Official Account (微信公众号) article** into clean, **RAG-ready Markdown** plus structured metadata — title, author, account name, publish time, cover image and all image URLs. Built for Chinese content teams, AI researchers and data engineers feeding WeChat content into **LLM / RAG pipelines**.

### Why this actor

- **No official API exists** for reading WeChat Official Account articles. This actor fills the gap.
- **No API key, no WeChat account, no cookies needed** for direct article URLs — article pages (`mp.weixin.qq.com/s/...`) are fetched with plain HTTP and parsed server-side.
- **Markdown-native output**: the article body (`#js_content`) is converted with Turndown, with WeChat's lazy-loaded `data-src` images rewritten to real URLs so no image is lost.
- **Pay-per-event pricing**: you only pay per article scraped. No start fee, no monthly minimum.

### Reliability — read this

| Mode | Reliability |
|---|---|
| **Direct article URLs** (`articleUrls`) | ✅ Fully reliable, keyless, no proxy needed |
| **Keyword discovery** (`searchKeywords`) | ⚠️ Best-effort. Uses Sogou WeChat search, which is **captcha-prone**. Without proxies it may work for a few queries, then get blocked. For production discovery use **residential proxies** (see `proxyConfiguration`). If discovery fails, the actor logs a warning and continues — direct URLs always work. |

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `articleUrls` | string\[] | `[]` | Direct WeChat article links (`https://mp.weixin.qq.com/s/...`). Fully reliable mode. No placeholder is prefilled — paste your own links. |
| `searchKeywords` | string\[] | — | Optional keywords for article discovery via Sogou WeChat search. Best-effort, captcha-prone. |
| `maxArticlesPerKeyword` | integer | `5` | Max articles scraped per keyword. |
| `includeImages` | boolean | `true` | Keep `![](url)` image markdown in the body. Image URLs are always collected in `images` regardless. |
| `proxyConfiguration` | object | — | Optional Apify proxy settings. Residential proxies recommended for keyword discovery. |

**At least one of `articleUrls` / `searchKeywords` is required** — the actor fails fast with a clear error otherwise.

#### Example input

```json
{
  "articleUrls": [
    "https://mp.weixin.qq.com/s/4gG0wmpjHS94fXEmAbfIXQ"
  ],
  "searchKeywords": ["人工智能"],
  "maxArticlesPerKeyword": 5,
  "includeImages": true
}
```

### Output

One dataset item per article:

| Field | Type | Description |
|---|---|---|
| `source` | string | `"url"` (direct link) or `"search"` (keyword discovery) |
| `keyword` | string | null | The keyword that found this article, or `null` for direct URLs |
| `articleUrl` | string | Canonical article URL |
| `title` | string | Article title |
| `author` | string | null | Article author(s) |
| `accountName` | string | Official Account (公众号) name |
| `publishTime` | string | null | ISO 8601 publish timestamp |
| `coverUrl` | string | null | Cover image URL |
| `markdown` | string | Full article body as clean Markdown |
| `textLength` | number | Plain-text length of the article body (chars) |
| `imageCount` | number | Number of images found in the body |
| `images` | string\[] | Image URLs (capped at 50) |
| `scrapedAt` | string | ISO 8601 scrape timestamp |

#### Example output item (markdown truncated)

```json
{
  "source": "url",
  "keyword": null,
  "articleUrl": "https://mp.weixin.qq.com/s/4gG0wmpjHS94fXEmAbfIXQ",
  "title": "欧盟ESG法规解读系列之《零毁林法案》对中国新能源汽车企业的影响",
  "author": "苏畅 刘阳禾",
  "accountName": "金杜研究",
  "publishTime": "2025-04-07T10:51:51.000Z",
  "coverUrl": "https://mmbiz.qpic.cn/mmbiz_jpg/.../0?wx_fmt=jpeg",
  "markdown": "# 欧盟ESG法规解读系列...\n\n![](https://mmbiz.qpic.cn/...)\n\n...",
  "textLength": 5210,
  "imageCount": 6,
  "images": ["https://mmbiz.qpic.cn/..."],
  "scrapedAt": "2026-08-19T18:55:00.000Z"
}
```

### Pricing

**$5.00 per 1,000 articles** — pay-per-event (`article` event), **no start fee**. You are charged only for articles successfully pushed to the dataset.

### Usage tips

- Feed the `markdown` field straight into your chunking/embedding pipeline — it's already cleaned of WeChat's wrapper noise.
- WeChat image URLs (`mmbiz.qpic.cn`) are hotlink-protected for browsers but downloadable server-side; fetch them soon after scraping if you need to archive them.
- Sogou-discovered article URLs are signed and time-limited — scrape them promptly, or re-run discovery to get fresh links.
- For large keyword-discovery jobs, enable **residential proxies** to avoid Sogou captchas.

### Limitations

- Deleted / account-restricted articles return an error page and are logged as failures (not charged).
- "Profile/list" pages (`mp.weixin.qq.com/mp/profile_ext?...`) are short-lived signed links and are **not** supported — use direct article URLs or keyword discovery.
- Keyword discovery depends on Sogou and can break or be captcha-blocked at any time; direct article URLs are the stable path.

# Actor input Schema

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

Direct WeChat article links (https://mp.weixin.qq.com/s/...). This mode is fully reliable. Add one or more URLs — no placeholder is prefilled, paste your own links.

## `searchKeywords` (type: `array`):

Keywords to discover articles via Sogou WeChat search (weixin.sogou.com). Best-effort: Sogou is captcha-prone, so discovery may fail without residential proxies. Article URLs above always work.

## `maxArticlesPerKeyword` (type: `integer`):

Maximum number of articles to scrape per search keyword.

## `includeImages` (type: `boolean`):

Keep image markdown (![](url)) in the article body. Image URLs are always collected in the images field regardless of this setting.

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

Optional Apify proxy settings. Recommended (residential proxies) when using keyword discovery, since Sogou frequently shows captchas to datacenter IPs.

## Actor input object example

```json
{
  "articleUrls": [],
  "maxArticlesPerKeyword": 5,
  "includeImages": true
}
```

# Actor output Schema

## `articlesDatasetUrl` (type: `string`):

Dataset containing one item per scraped article.

# 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 = {
    "articleUrls": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("technicaldost/wechat-article-markdown-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 = { "articleUrls": [] }

# Run the Actor and wait for it to finish
run = client.actor("technicaldost/wechat-article-markdown-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 '{
  "articleUrls": []
}' |
apify call technicaldost/wechat-article-markdown-scraper --silent --output-dataset

```

## MCP server setup

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