# 好看视频 API | Haokan Search, Comments & User Posts (`socialdatax/socialdatax-haokan-data-api`) Actor

社媒数据助手 SocialDataX 提供百度好看视频搜索、视频详情、评论与回复、用户搜索及作品列表。Baidu Haokan API for video search, comments, replies, creator profiles and user videos. Export JSON, CSV, Excel. 无需配置 SocialDataX API Key。

- **URL**: https://apify.com/socialdatax/socialdatax-haokan-data-api.md
- **Developed by:** [SocialDataX](https://apify.com/socialdatax) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

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

## 好看视频 API | SocialDataX Haokan

社媒数据助手 SocialDataX 提供百度好看视频搜索、视频详情、评论与回复、用户资料及作品列表。Baidu Haokan video search API for videos, comments and creator data. 结果写入 Dataset，可导出 JSON、CSV、Excel，无需填写 SocialDataX API Key。

### 价格

每千条 Dataset 结果 **$2.99**（每条 $0.00299），所有操作统一计价。仅成功写入 Dataset 的结果按条计费，空结果不产生结果费用；每个启动事件另收 $0.00005，按 Apify 内存计费规则计算。运行中的平台费用包含在上述价格中。

### 选择能力

| operation | 必填 / 入口 | 分页 |
| --- | --- | --- |
| `search_videos` | keyword | 支持 |
| `search_users` | keyword | 支持 |
| `search_suggestions` | keyword | 不支持 |
| `get_hot_search_list` | 无 | 不支持 |
| `get_video_detail` | video_id / url（二选一） | 不支持 |
| `get_video_comments` | video_id / url（二选一） | 支持 |
| `get_comment_replies` | comment_id, video_id / url（二选一） | 支持 |
| `get_user_info` | user_id / url（二选一） | 不支持 |
| `list_user_videos` | user_id / profile_url（二选一） | 支持 |

### 使用说明

- ID 请以字符串传入，避免长整数精度丢失。使用搜索结果中的 ID 或链接，不要把链接放入 ID 字段。
- 评论回复需要内容 ID 和一级评论 ID，不要使用回复自身的 ID。
- 默认最多20条，上限1000条。自动分页只用于支持分页的操作；空页有令牌时仍会继续。
- 结果上限截断当前页时，OUTPUT 会提示续页令牌将跳过未导出条目；需要完整当前页时请提高上限。
- Dataset 保留完整字段，作者对象展开为 author\_\*；嵌套数组保留，预览视图不限制导出字段。
- 持续使用需要 Apify 付费计划；免费计划有5次 SocialDataX API 请求试用额度，分页与重试都会消耗次数。Apify 赠送金额与本试用请求额度分别计算。

### 示例

#### 关键词搜索

```json
{
  "operation": "search_videos",
  "keyword": "美食",
  "max_items": 20,
  "auto_paginate": true
}
```

以下示例使用已验收的公开样本，每次最多导出3条、关闭自动分页，便于先确认返回内容。样本内容可能随平台变化。

#### 获取用户作品

将 user_id 换成用户搜索结果中的用户 ID；也可以改用 profile_url，两个字段只填一个。

```json
{
  "operation": "list_user_videos",
  "user_id": "1701628187575434",
  "max_items": 3,
  "auto_paginate": false
}
```

支持与接入：[SocialDataX](https://socialdatax.com/ai?from=apify)。

# Actor input Schema

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

选择能力；仅填写对应字段。详情和资料查询支持 ID 或链接二选一。

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

视频搜索词，例如科技、美食或品牌名；不要传视频链接、用户主页链接或分页令牌。

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

首页留空；续页原样传回同一操作的完整 next_page_token，保持搜索词、ID、排序和筛选条件不变。

## `video_id` (type: `string`):

好看视频数字 ID，以字符串传入，例如 6148991337208256393；可从视频搜索结果的 video_id 获取。

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

填写所选操作对应的完整链接，与该操作的 ID 二选一。不要同时填写 ID 和链接。

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

所属一级评论 ID，取视频评论列表中的 comment_id；不要传回复自身的 ID。

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

好看视频用户 ID：用户搜索结果取 user_id；视频搜索、视频详情或评论结果中的作者取 author_user_id。支持数字和字母数字标识，不要传空值。

## `profile_url` (type: `string`):

填写所选操作对应的完整链接，与该操作的 ID 二选一。不要同时填写 ID 和链接。

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

列表总导出上限；详情与资料最多1条。仅成功写入 Dataset 的结果按条计费，另有启动费。

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

有分页能力时自动续页，直到达到上限或令牌为空；空页有令牌仍会继续。无分页能力的操作只请求一次。

## Actor input object example

```json
{
  "operation": "search_videos",
  "keyword": "美食",
  "max_items": 20,
  "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-haokan-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-haokan-data-api").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 '{}' |
apify call socialdatax/socialdatax-haokan-data-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,socialdatax/socialdatax-haokan-data-api"
        }
    }
}
```

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/aIjCFXqM9hsAY6A5S/builds/cL3knfzNvzArIP94T/openapi.json
