# WeChat Ultimate Scraper (`khnaami/actor-wechat-scraper`) Actor

Extract WeChat Official Account articles (公众号文章), clean plain text & Markdown for AI translation, embedded HD images, and keyword search with zero WeChat account or QR code needed.

- **URL**: https://apify.com/khnaami/actor-wechat-scraper.md
- **Developed by:** [khalid naami](https://apify.com/khnaami) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 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/actors/running/actors-in-store.md#pay-per-usage

## 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 (微信) Ultimate Scraper (Official Accounts, Articles, Markdown & Search)

High-speed, all-in-one WeChat (微信) data extraction and intelligence engine on Apify. Extract **WeChat Official Account Articles (微信公众号文章)** with full text, clean Markdown & Plain text for AI/LLMs & translation, **Images & Media**, **Publication & Author Metadata**, and **Keyword Search** without requiring a WeChat account or mobile app.

***

### ⚡ Key Features

- 📑 **Complete Official Account Articles**: Scrape public WeChat articles (`mp.weixin.qq.com/s/...`) with Title, Official Account Name (公众号名称), WeChat Public ID (微信号), Author, Excerpt/Digest, and Publish timestamp.
- 🤖 **AI & Translation-Ready Clean Text**: Extracts unbloated, clean plain text and Markdown from articles — perfect for feeding LLMs, automated Chinese-to-English translation pipelines, sentiment analysis, and RAG vector stores.
- 🖼️ **Full Media & HD Images Extraction**: Resolves all CDN image URLs embedded across the article (`mmbiz.qpic.cn`), plus cover images.
- 🏷️ **Original Article Verification**: Automatically detects whether an article is an official original piece (`原创`) or syndicated content.
- 🔍 **WeChat Keyword Search**: Search across WeChat Official Accounts for any topic or keyword (supports both Chinese and English, e.g. *人工智能*, *新能源汽车*, *跨境电商*).
- 📧 **Direct Lead Generation**: Automatically extracts business contact emails and phone numbers found in article footers and company intros.
- 🌐 **Zero WeChat Login Required**: Runs completely without needing a WeChat app, QR code scan, or phone verification.
- 🛡️ **Dual-Engine Speed & Reliability**: Fast HTTP requests via `got-scraping` paired with an intelligent Playwright browser fallback.

***

### 📥 Input Configuration

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `mode` | String | `AUTO_DETECT` | Extraction mode: `AUTO_DETECT`, `ARTICLES`, `SEARCH`. |
| `targetUrls` | Array | `[...]` | List of WeChat article links (`https://mp.weixin.qq.com/s/...`). |
| `searchKeywords` | Array | `[]` | Keywords to search across WeChat Official Accounts (e.g. `人工智能`). |
| `maxItems` | Integer | `30` | Maximum articles to extract per search query. |
| `extractFullText` | Boolean | `true` | Extract clean plain text for AI and translation workflows. |
| `proxyConfiguration` | Object | `{ useApifyProxy: true }` | Apify Residential proxy configuration (recommended). |

***

### 📤 Output Data Format

#### 1. WeChat Official Account Article Record (AI Ready)

```json
{
  "type": "ARTICLE",
  "id": "30NfP1E616cZ6p2111",
  "url": "https://mp.weixin.qq.com/s/30NfP1E616cZ6p2111",
  "title": "2026年全球人工智能算力发展趋势全景报告",
  "accountName": "AI科技评论",
  "wechatId": "aitechnology_review",
  "author": "张伟",
  "digest": "本文深入分析了下一代AI芯片、大模型算力基础设施与企业落地趋势。",
  "bodyText": "随着生成式AI从单模态走向全模态推理，算力基础设施的需求结构正在经历剧烈重塑...",
  "coverImageUrl": "https://mmbiz.qpic.cn/sz_mmbiz_jpg/.../640",
  "imageUrls": [
    "https://mmbiz.qpic.cn/sz_mmbiz_png/.../640",
    "https://mmbiz.qpic.cn/sz_mmbiz_png/.../640"
  ],
  "publishDate": "2026-10-08T10:30:00.000Z",
  "publishTimestamp": 1791407400,
  "isOriginal": true,
  "wordCount": 3450,
  "scrapedAt": "2026-10-09T22:50:00.000Z"
}
```

***

### 💼 China Market & AI Research Use Cases

- **China Macro & Tech Industry Monitoring**: Track official publications, tech giants (Tencent, Alibaba, ByteDance), and policy announcements in real time.
- **Multilingual LLM Training & Translation**: Create vast parallel corpora of high-quality Chinese articles for machine translation, fine-tuning, and RAG pipelines.
- **Competitor Intelligence & Brand Tracking**: Monitor how global and domestic brands communicate with Chinese consumers on WeChat.

***

### 📄 License

Apache-2.0

# Actor input Schema

## `mode` (type: `string`):

Select WeChat extraction mode, or use AUTO_DETECT.

## `targetUrls` (type: `array`):

List of WeChat article links (https://mp.weixin.qq.com/s/...).

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

Keywords to search across WeChat Official Accounts (supports Chinese & English, e.g., '人工智能', 'AI Agents').

## `maxItems` (type: `integer`):

Maximum number of articles to extract per search keyword.

## `extractFullText` (type: `boolean`):

If enabled, extracts clean plain text unbloated by HTML for AI/LLM summarization, translation, and RAG.

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

Select Apify Proxy (RESIDENTIAL recommended for WeChat to avoid anti-bot checks).

## Actor input object example

```json
{
  "mode": "AUTO_DETECT",
  "targetUrls": [
    "https://mp.weixin.qq.com/s/30NfP1E616cZ6p2111-sample"
  ],
  "searchKeywords": [
    "人工智能"
  ],
  "maxItems": 30,
  "extractFullText": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Scraped WeChat records (Articles, Official Accounts, Search Results)

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

High-level summary report and execution metrics stored in Key-Value store

# 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 = {
    "targetUrls": [
        "https://mp.weixin.qq.com/s/30NfP1E616cZ6p2111-sample"
    ],
    "searchKeywords": [
        "人工智能"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("khnaami/actor-wechat-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 = {
    "targetUrls": ["https://mp.weixin.qq.com/s/30NfP1E616cZ6p2111-sample"],
    "searchKeywords": ["人工智能"],
}

# Run the Actor and wait for it to finish
run = client.actor("khnaami/actor-wechat-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 '{
  "targetUrls": [
    "https://mp.weixin.qq.com/s/30NfP1E616cZ6p2111-sample"
  ],
  "searchKeywords": [
    "人工智能"
  ]
}' |
apify call khnaami/actor-wechat-scraper --silent --output-dataset

```

## MCP server setup

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