# 微信视频号 / WeChat Channels API - 视频搜索、评论 / comments、用户数据 (`socialdatax/socialdatax-wechat-data-api`) Actor

社媒数据助手 SocialDataX 提供的只读微信视频号 / WeChat Channels data API，支持热搜 / hot list、视频搜索 / video search、视频详情 / video details、评论 / comments、评论回复 / comment replies、用户资料 / creator profiles 和用户视频列表 / creator videos。

- **URL**: https://apify.com/socialdatax/socialdatax-wechat-data-api.md
- **Developed by:** [SocialDataX](https://apify.com/socialdatax) (community)
- **Categories:** Social media, Videos, Developer tools
- **Stats:** 23 total users, 12 monthly users, 96.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 1,000 dataset items

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/platform/actors/running/actors-in-store#pay-per-event

## 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 Channels API - 视频搜索、评论 / comments、用户数据

这是社媒数据助手 SocialDataX 的 Apify Actor 适配层，提供只读微信视频号 / WeChat Channels data API，面向 WeChat Channels video search / 视频号搜索、WeChat Channels comments / 视频号评论、视频详情、用户资料、用户视频列表和 Dataset export 场景。

用户在 Apify 上运行时不需要配置 SocialDataX API Key。API Key 由 SocialDataX 在 Actor 环境中配置。

### Support / 联系我们

如果 run 失败、需要更高用量，或想接入批量数据工作流，请通过 SocialDataX support 联系我们：

- Website: <https://socialdatax.com/>

If a run fails, you need higher limits, or you want to discuss a bulk data workflow, contact SocialDataX support:

- Website: <https://socialdatax.com/>

### 支持能力 / Operations

- 热搜 / hot list
- 视频搜索 / video search
- 视频详情 / video details
- 评论列表 / comments
- 评论回复 / comment replies
- 用户资料 / creator profile
- 用户视频列表 / creator videos

默认 operation 是 `search_videos`，默认关键词是 `露营`。

### 输入字段 / Input

| Operation | 必填字段 | 可选字段 | 说明 |
| --- | --- | --- | --- |
| `search_hot_list` | 无 | `max_items` | 获取微信视频号热榜数据，请求一次并按 `max_items` 限制写入 Dataset。 |
| `search_videos` | `keyword` | `sort_type`, `duration_range`, `page_token`, `max_items`, `auto_paginate` | 按关键词搜索视频号内容，默认自动翻页直到达到 `max_items`。 |
| `get_video_detail` | `url` 或 `encrypted_object_id` | 无 | 获取单条视频详情；只能二选一，不要两个都填。 |
| `get_video_comments` | `url` 或 `object_id + object_nonce_id` | `page_token`, `max_items`, `auto_paginate` | 获取一级评论列表；只能二选一，不要同时填视频链接和 ID 组合。 |
| `get_video_comment_replies` | `object_id`, `object_nonce_id`, `comment_id` | `page_token`, `max_items`, `auto_paginate` | 获取一级评论下的回复。先运行评论列表，从 Dataset 行里复制真实 ID。 |
| `get_user_info` | `user_id` | 无 | 获取微信视频号用户资料。`user_id` 应以 `@finder` 结尾。 |
| `list_user_videos` | `user_id` 或 `url` | `page_token`, `max_items`, `auto_paginate` | 获取用户发布视频列表。 |

#### 字段提示

- `keyword`: 仅用于 `search_videos`，默认示例是 `露营`。
- `url`: 推荐直接粘贴微信视频号视频链接或分享文案，适用于视频详情、评论列表和用户视频列表。
- `encrypted_object_id`: 从 `search_videos` 的 Dataset 行复制，用于 `get_video_detail`。
- `object_id` / `object_nonce_id`: 从 `get_video_detail` 或评论 Dataset 行复制，用于评论和评论回复。
- `comment_id`: 从 `get_video_comments` Dataset 行复制一级评论 ID。建议选择 `reply_count > 0` 的评论。
- `user_id`: 只填以 `@finder` 结尾的视频号用户 ID；不要填昵称、主页名称或 `@stranger` ID。
- `sort_type`: `all`、`time_descending`、`collect_count_descending`。
- `duration_range`: `all`、`under_5_min`、`between_5_and_20_min`、`over_20_min`。
- `max_items`: 默认 `50`，最大 `1000`。
- `auto_paginate`: 默认 `true`。每请求一页会计为 1 次 SocialDataX API request。

### 示例 / Examples

视频搜索：

```json
{
  "operation": "search_videos",
  "keyword": "露营",
  "sort_type": "all",
  "duration_range": "all",
  "page_token": "",
  "max_items": 20,
  "auto_paginate": true
}
```

热榜：

```json
{
  "operation": "search_hot_list",
  "max_items": 20
}
```

视频详情：

```json
{
  "operation": "get_video_detail",
  "url": "https://weixin.qq.com/sph/ANxgB9MB8i"
}
```

评论列表：

```json
{
  "operation": "get_video_comments",
  "url": "https://weixin.qq.com/sph/ANxgB9MB8i",
  "page_token": "",
  "max_items": 20,
  "auto_paginate": true
}
```

评论回复：

```json
{
  "operation": "get_video_comment_replies",
  "object_id": "14469096051103173201",
  "object_nonce_id": "4041472331870621547_0_39_0_0",
  "comment_id": "14608046980043114941",
  "page_token": "",
  "max_items": 20,
  "auto_paginate": true
}
```

用户资料：

```json
{
  "operation": "get_user_info",
  "user_id": "v2_060000231003b20faec8c5e58110c0dcc90cee33b0777dd2f17b0e35693b274a9dd455cde24f@finder"
}
```

用户视频列表：

```json
{
  "operation": "list_user_videos",
  "url": "https://weixin.qq.com/sph/ANxgB9MB8i",
  "page_token": "",
  "max_items": 20,
  "auto_paginate": true
}
```

### 输出 / Dataset

主要消费面是 Apify Dataset。列表类 operation 会把每个 item 写成一行，适合 JSON、CSV、Excel / XLSX、JSONL 导出。

行结构是扁平字段：

- `operation`, `item_index`
- `query_*`: 本次请求参数
- `page_*`: 页级分页和统计信息
- item 顶层字段，例如 `object_id`, `description`, `comment_id`, `like_count`
- `author_*`, `video_*`: 常见对象字段展开
- `topic_tags`, `images`: 数组字段保留 JSON 值

示例 Dataset row：

```json
{
  "operation": "get_video_comments",
  "item_index": 1,
  "query_object_id": "14469096051103173201",
  "query_object_nonce_id": "4041472331870621547_0_39_0_0",
  "comment_id": "14608046980043114941",
  "content": "这个路线不错",
  "author_user_id": "v2_...@finder",
  "author_name": "示例用户",
  "reply_count": 2,
  "page_next_page_token": ""
}
```

`OUTPUT` 只保留 run summary、请求页摘要、warning 或轻量错误信息，方便调试；完整结果请从 Dataset 读取。

### Apify API 调用

同步运行并直接取 Dataset items：

```bash
curl -X POST "https://api.apify.com/v2/acts/socialdatax~socialdatax-wechat-data-api/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "operation": "search_videos",
    "keyword": "露营",
    "max_items": 20,
    "auto_paginate": true
  }'
```

Python client：

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("socialdatax/socialdatax-wechat-data-api").call(run_input={
    "operation": "search_videos",
    "keyword": "露营",
    "max_items": 20,
    "auto_paginate": True,
})

items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(items[:3])
```

### 计费 / Pricing

持续使用需要 Apify paid plan。Apify free plan 用户有 5 次 SocialDataX API request 试用额度；每次请求一个接口页面计 1 次，`auto_paginate=true` 时每翻一页都会计入一次。试用额度用完后，请升级 Apify 计划继续使用。

Apify 用户按 Actor 页面展示的 Apify 价格和用量计费，不需要购买或配置 SocialDataX API Key。

# Actor input Schema

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

先选择要调用的微信视频号 / WeChat Channels 数据能力，然后只填写该 operation 需要的字段；无关字段会被忽略。持续使用需要 Apify paid plan；free plan 用户有 5 次 SocialDataX API request 试用额度。Choose the operation first, then fill only the fields used by that operation.

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

仅 operation=search\_videos 时必填；其它 operation 可留空。Search keyword for WeChat Channels video search.

## `sort_type` (type: `string`):

仅 operation=search\_videos 时使用。all=综合，time\_descending=最新优先，collect\_count\_descending=收藏数优先。

## `duration_range` (type: `string`):

仅 operation=search\_videos 时使用。all=全部，under\_5\_min=5 分钟以下，between\_5\_and\_20\_min=5-20 分钟，over\_20\_min=20 分钟以上。

## `url` (type: `string`):

operation=get\_video\_detail、get\_video\_comments、list\_user\_videos 时可使用。推荐直接粘贴微信视频号视频链接或分享文案。详情接口不要同时传 url 和 encrypted\_object\_id；评论接口不要同时传 url 和 object\_id + object\_nonce\_id。

## `encrypted_object_id` (type: `string`):

operation=get\_video\_detail 时可使用；从 search\_videos Dataset 行里的 encrypted\_object\_id 复制。不要和 url 同时填写。

## `object_id` (type: `string`):

operation=get\_video\_comments、get\_video\_comment\_replies 时使用；与同一条视频的 object\_nonce\_id 一起从 get\_video\_detail 或评论 Dataset 行中复制。评论回复不支持 url 或 encrypted\_object\_id。

## `object_nonce_id` (type: `string`):

operation=get\_video\_comments、get\_video\_comment\_replies 时使用；必须和同一条视频的 object\_id 配对原样传入。

## `comment_id` (type: `string`):

仅 operation=get\_video\_comment\_replies 时必填。先运行 get\_video\_comments，在 Dataset 里找到 reply\_count > 0 的一级评论行，复制该行的 comment\_id；不要填评论内容、昵称或回复项 ID。

## `user_id` (type: `string`):

operation=get\_user\_info、list\_user\_videos 时使用。只支持以 @finder 结尾的微信视频号用户 ID；可从视频详情、评论、评论回复或用户视频列表 Dataset 行里的 author\_user\_id / user\_id 复制。不要填昵称、主页名称或 @stranger ID。

## `page_token` (type: `string`):

搜索、评论、评论回复、用户视频列表继续翻页时传入上一页返回的完整 next\_page\_token；第一页留空。auto\_paginate=true 时通常不用手动填写。

## `max_items` (type: `integer`):

最多写入多少条 Dataset item。对搜索、评论、评论回复、用户视频列表用于限制自动翻页结果；对热搜用于限制本次导出的热搜条目数。较大的值可能触发多次 SocialDataX API request。

## `auto_paginate` (type: `boolean`):

开启后 Actor 会按 next\_page\_token 继续请求，直到达到 max\_items 或没有下一页。关闭时只请求当前 page\_token。每翻一页计 1 次 SocialDataX API request。When enabled, each page request counts as one SocialDataX API request.

## Actor input object example

```json
{
  "operation": "search_videos",
  "keyword": "露营",
  "sort_type": "all",
  "duration_range": "all",
  "max_items": 50,
  "auto_paginate": true
}
```

# Actor output Schema

## `dataset` (type: `string`):

Open flat result rows written to the default Apify Dataset. Export as JSON, CSV, Excel / XLSX, or JSONL.

## `keyValueStore` (type: `string`):

Open the default key-value store. The OUTPUT record contains operation, item count, request count, page-level response summaries, non-fatal warnings, and lightweight failure details when a run fails.

# 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("socialdatax/socialdatax-wechat-data-api").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("socialdatax/socialdatax-wechat-data-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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 socialdatax/socialdatax-wechat-data-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=socialdatax/socialdatax-wechat-data-api",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/9unGLordk5LcQ9Wd9/builds/wX6aGfVCT1AIIoBqi/openapi.json
