# WeChat Scraper (`datahamster/wechat-scraper`) Actor

WeChat scraper for Official Account articles: search by keyword through Sogou WeChat search and get title, account, publish time, snippet, the real mp.weixin.qq.com link, cover image and full article text. No login. Monitor mode returns only new articles.

- **URL**: https://apify.com/datahamster/wechat-scraper.md
- **Developed by:** [Viktor Dubnytskiy](https://apify.com/datahamster) (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

from $1.68 / 1,000 result items

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 Scraper

Search WeChat Official Account (公众号) articles by keyword and get one row per article: title, publishing account, publish time, Sogou's snippet, the real `mp.weixin.qq.com` link, cover image and the full article text. No WeChat account, no login, no QR code. The actor reads Sogou WeChat search (weixin.sogou.com), the only public search index of WeChat articles, and follows each result to the article page.

**Try it:** the prefilled example returns 5 rows in about 30 seconds and costs about $0.01. Results cost $2.10 per 1,000.

### What you get

Real rows from the prefilled run (`queries: ["人工智能"]`, 2026-11-02):

| title | accountName | publishedAt (UTC) | bodyLength | articleUrl |
|---|---|---|---|---|
| 军事人工智能决策系统的联盟应用、现实困境与发展对策 | 战略前沿技术 | 2026-11-02 15:29 | 3290 | `https://mp.weixin.qq.com/s?src=11&timestamp=17936433...` |
| 数据知识产权与人工智能产业创新融合路径研究 | 战略前沿技术 | 2026-11-02 15:29 | 6531 | `https://mp.weixin.qq.com/s?src=11&timestamp=17936433...` |
| 科技让工业更美好!山东魏桥在济南成立人工智能公司 | 奔跑的电力人 | 2026-11-02 14:03 | 1850 | `https://mp.weixin.qq.com/s?src=11&timestamp=17936433...` |

Start of `body` for the fifth row (华为云): "当前，AI正从单点技术应用走向企业核心业务，成为产业智能化转型中的一项重要技术变量。对于企业而言，AI落地并非简单接入大..."

Full row: `id`, `url`, `title`, `accountName`, `publishedAt`, `publishedTimestamp`, `snippet`, `articleUrl`, `sogouUrl`, `coverImage`, `body`, `bodyStatus`, `bodyLength`, `query`, `page`, `rank`, `scrapedAt`.

- `id` is Sogou's document id of the article. It stays the same between runs, so it is safe for deduplication and monitoring.
- `articleUrl` is the `mp.weixin.qq.com/s?src=11&timestamp=...&signature=...` link Sogou hands out. WeChat signs it for a limited time (about a day), so open or archive it soon after the run.
- `body` is the article text with paragraphs on separate lines. E-mail addresses, phone numbers, WeChat IDs and QQ numbers are removed. Reader comments are never collected.
- `bodyStatus` is `ok`, or `skipped` when `fetchArticleBody` is off. With the body on, articles that are deleted, expired or behind WeChat's verification page are left out of the dataset, and so are results whose Sogou link hop was refused.

### Use cases

- **Chinese media monitoring.** Track what WeChat Official Accounts publish about your brand, competitors or industry. WeChat articles are invisible to Google, and Sogou is the public way in.
- **Market and policy research.** Collect full article texts on a topic for translation, summarisation or sentiment analysis with an LLM.
- **Content discovery.** Find which accounts write about a niche and how often they publish.

### How to use it

**One-off search**: press **Start**. The prefilled input works as is (`queries: ["人工智能"]`, one page, 5 articles).

**Monitor mode**: save a task with

```json
{
  "queries": ["你的品牌", "your brand"],
  "maxPagesPerQuery": 2,
  "fetchArticleBody": false,
  "mode": "monitor",
  "monitorStateId": "brand-watch"
}
```

and schedule it (Apify, Schedules, for example every 6 hours). Each run charges one `monitor-check` and returns only articles that were not in earlier runs. For frequent monitors keep `fetchArticleBody` off: runs are faster and lighter, and you still get the title, account, time, snippet and article link of every new article.

### Related actors

- [Bilibili Scraper](https://apify.com/datahamster/bilibili-videos): Bilibili video search with views, likes and danmaku counts.
- [Telegram Channel Search Scraper](https://apify.com/datahamster/telegram-channels-search): find public Telegram channels by keyword.
- [Google News Scraper](https://apify.com/datahamster/google-news-feed): Google News articles for any keyword, with a monitor mode.
- [Website to Markdown](https://apify.com/datahamster/website-to-markdown): turn any web page into clean Markdown for LLMs.

### Input

| Field | Meaning | Default |
|---|---|---|
| `queries` | Keywords, one per line. Chinese works best, English and brand names work too | `["人工智能"]` |
| `fetchArticleBody` | Open each article and return its text (one extra request per article) | `true` |
| `maxPagesPerQuery` | Sogou result pages per query, 10 articles each, 1 to 10 | `10` (prefill 1) |
| `maxItems` | Stop the run after this many rows | `100` (prefill 5) |
| `mode`, `monitorStateId`, `webhookUrl`, `telegramBotToken`, `telegramChatId` | Monitor mode settings | `scrape` |

### Pricing

| Event | Price |
|---|---|
| result | $0.0021 per article ($2.10 per 1,000) |
| monitor-check | $0.005 per monitor run |
| change | $0.0021 per new article in monitor mode |

Apify Store discounts: SILVER -10%, GOLD and higher -20% on every event.

You pay only for rows actually pushed. Rows without a resolved article link are not charged. With `fetchArticleBody` on, deleted, expired or walled articles are not charged either. A query that finds nothing charges no result events. Platform usage is billed by Apify on top; the actor needs no proxy while Sogou answers directly.

### Limits

- Sogou shows at most 100 results (10 pages) per query to visitors who are not logged in. For more articles, split a topic into several narrower queries.
- Sogou's ranking mixes relevance and recency. It is not a complete archive of an account.
- `articleUrl` is a temporary signed link (see above). Sogou does not expose the permanent `__biz/mid/idx/sn` link.
- When Sogou shows its anti-bot check, the actor moves to a different proxy for the rest of the run. If every page is refused, the run ends with reason `blocked` in `RUN_SUMMARY` and nothing is charged.
- Deleted, expired or walled articles are skipped when `fetchArticleBody` is on, so a page of 10 results can give fewer than 10 rows.

### FAQ

**Do I need a WeChat account?** No. Search and article pages are public web pages.

**Can I search one specific Official Account?** Put the account name in the query, for example `量子位 大模型`. Sogou's account filter needs a login and is not used.

**What happens when nothing matches?** No rows, no result charges. `RUN_SUMMARY` in the run's key-value store says `no_matches`.

### Changelog

- 0.1: first release with keyword search, link resolution, article text and monitor mode.

***

If this actor saved you time, a short review on its Store page helps other people find it. Found a bug or need a field? Open a ticket on the **Issues** tab.

# Actor input Schema

## `queries` (type: `array`):

Keywords, one per line, e.g. "人工智能", "新能源汽车" or a brand name. Chinese keywords find the most articles.

## `fetchArticleBody` (type: `boolean`):

true = open every article and return its full text in body (one extra request per article). false = search data and link only, faster.

## `maxPagesPerQuery` (type: `integer`):

Sogou result pages per query, 10 articles each, e.g. 3. Sogou shows at most 10 pages (100 results) without login.

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

Stop the run after this many articles, e.g. 5. You are charged only for pushed rows.

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

scrape = full results; monitor = only new/changed items since the previous run of this task

## `monitorStateId` (type: `string`):

Optional state id when not running as a saved task (monitor mode)

## `webhookUrl` (type: `string`):

POST a change summary here in monitor mode

## `telegramBotToken` (type: `string`):

Optional: bot token for monitor-mode change summaries

## `telegramChatId` (type: `string`):

Optional: chat id that receives monitor-mode summaries

## Actor input object example

```json
{
  "queries": [
    "人工智能"
  ],
  "fetchArticleBody": true,
  "maxPagesPerQuery": 1,
  "maxItems": 5,
  "mode": "scrape"
}
```

# Actor output Schema

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

All pushed rows (dataset, JSON)

## `resultsTable` (type: `string`):

Dataset in the Console viewer

## `runSummary` (type: `string`):

RUN_SUMMARY record

# 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 = {
    "queries": [
        "人工智能"
    ],
    "maxPagesPerQuery": 1,
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("datahamster/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 = {
    "queries": ["人工智能"],
    "maxPagesPerQuery": 1,
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("datahamster/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 '{
  "queries": [
    "人工智能"
  ],
  "maxPagesPerQuery": 1,
  "maxItems": 5
}' |
apify call datahamster/wechat-scraper --silent --output-dataset

```

## MCP server setup

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