# WeChat Official Account Articles & Public Post Extractor (`oneary/wechat-official-account`) Actor

Extract WeChat Official Account (微信公众号) articles, digests, authors, cover images, and account profiles by keyword or account name — works out-of-the-box with no API key required.

- **URL**: https://apify.com/oneary/wechat-official-account.md
- **Developed by:** [Luan M.](https://apify.com/oneary) (community)
- **Categories:** Social media, News
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 article or official account records

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 Official Account Articles & Public Post Extractor

Extract **WeChat Official Account (微信公众号)** articles, trending posts, account profiles, article summaries (`digest`), cover images, and publication timestamps by keyword or account name — **with zero API keys or cookies required**.

### Key Features

- **No API Key Required (Works Out-of-the-Box)**: Extracts public WeChat Official Account articles and account profiles directly without requiring users to bring external API keys or WeChat cookies.
- **6 Supported Operations**:
  - `article_search`: Search WeChat Official Account articles by Chinese or English keyword.
  - `hot_articles`: Extract latest trending articles on any topic.
  - `account_search`: Discover verified WeChat Official Accounts (公众号) publishing on a topic.
  - `account_info`: Retrieve Official Account metadata and latest post details.
  - `history_articles`: Fetch recent articles published by a specific Official Account.
  - `article_detail`: Inspect article metadata by URL.
- **Clean Normalized Output**: Every record includes `title`, `digest`, `url`, `author` / `accountName`, `publishTime`, `publishDateIso`, `coverUrl`, and `docId`.

### Example Input

```json
{
  "operation": "article_search",
  "keyword": "人工智能",
  "maxItems": 10
}
```

### Example Output

```json
{
  "type": "article",
  "operation": "article_search",
  "title": "AI+医疗,竟然是这样落地的",
  "digest": "题图|视觉中国今年3月份,科技界的大佬们,如英伟达和谷歌都表达了对AI医疗的重视,这让整个市场对这个领域的兴趣又热了起来...",
  "url": "https://weixin.sogou.com/link?url=...",
  "appMsgId": 7482910384,
  "docId": "ab735a258a90e8e1-6bee54fcbd896b2a-df4ddd38cc6dae3b35190899be8af7e0",
  "msgType": 9,
  "index": 1,
  "author": "虎嗅APP",
  "accountName": "虎嗅APP",
  "publishTime": 1713780635,
  "publishDateIso": "2024-04-22T10:10:35+00:00",
  "coverUrl": "https://mmbiz.qpic.cn/mmbiz_jpg/...",
  "keyword": "人工智能"
}
```

# Actor input Schema

## `operation` (type: `string`):

Choose whether to search WeChat Official Account articles, discover Official Accounts, or inspect account history.

## `keyword` (type: `string`):

Keyword or topic to search across WeChat Official Accounts and articles (supports Chinese & English, e.g., '人工智能', 'AI', '跨境电商', '新能源汽车').

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

Optional Official Account name or alias (e.g., '人民日报', '虎嗅APP', 'rmrbwx') for account_info or history_articles.

## `articleUrl` (type: `string`):

Optional WeChat article URL for article_detail operation.

## `publishTime` (type: `string`):

Time window filter for article searches.

## `sort` (type: `string`):

Sort search results by relevance or publication time.

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

Maximum number of WeChat Official Account articles or accounts to return.

## `tikhubApiKey` (type: `string`):

Completely optional. The actor works out-of-the-box without any API key using public WeChat search feeds.

## Actor input object example

```json
{
  "operation": "article_search",
  "keyword": "人工智能",
  "publishTime": "all",
  "sort": "default",
  "maxItems": 10
}
```

# Actor output Schema

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

Dataset records produced by the Actor.

# 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 = {
    "operation": "article_search",
    "keyword": "人工智能",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("oneary/wechat-official-account").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 = {
    "operation": "article_search",
    "keyword": "人工智能",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("oneary/wechat-official-account").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 '{
  "operation": "article_search",
  "keyword": "人工智能",
  "maxItems": 10
}' |
apify call oneary/wechat-official-account --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,oneary/wechat-official-account"
        }
    }
}
```

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/HPhV9wPJYoKBODytO/builds/swdkHQ5hpbyYFJyTb/openapi.json
