# Xigua 西瓜视频 Search Scraper - Keyword + Comments + MP4 下载 (`zen-studio/xigua-video-search-scraper`) Actor

Search Xigua (西瓜视频) by keyword or hashtag — up to 1,000 videos with title, author, engagement stats, 1080p/720p/480p MP4 download URLs, hashtags, covers, optional comments and replies. Cross-app linkage to Douyin (抖音). 西瓜视频下载 / 爬虫.

- **URL**: https://apify.com/zen-studio/xigua-video-search-scraper.md
- **Developed by:** [Zen Studio](https://apify.com/zen-studio) (community)
- **Categories:** Social media, Videos, Agents
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $12.49 / 1,000 videos

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## 西瓜视频搜索爬虫 Xigua Video Search Scraper | 视频元数据 · 评论 · 播放链接 (2026)

<blockquote style="border-left:4px solid #4C945E;background:#F0FDF4;padding:12px 16px">
<span style="font-size:16px;font-weight:700;color:#1C1917">每段视频 100+ 字段，评论回复与播放链接一次抓取</span> <span style="font-size:15px;color:#57534E"> · 100+ fields per video with full comments, replies, and resolved playback URLs.</span>
</blockquote>

<table style="width:100%">
<tr>
<td colspan="4" style="padding:10px 14px;background:#4C945E;border:none;border-radius:4px 4px 0 0">
<span style="color:#FAFAF9;font-size:14px;font-weight:700;letter-spacing:0.5px">Zen Studio China Scrapers</span>
<span style="color:#D7F4DD;font-size:13px">&nbsp;&nbsp;&bull;&nbsp;&nbsp;西瓜视频、闲鱼等中国平台数据抓取</span>
</td>
</tr>
<tr>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-radius:0 0 0 4px;border-right:none;border-top:none;background:#E8F5E9;vertical-align:top;width:25%">
<span style="color:#4C945E;text-decoration:none;font-weight:700;font-size:13px">西瓜视频 Xigua Search</span><br>
<span style="color:#4C945E;font-size:11px;font-weight:600">&#10148; 当前 You are here</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-right:none;border-top:none;vertical-align:top;width:25%">
<span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/NWYsOG96fMDy8ycdf-actor-5QcLc4BHaLMBUKYs3-f3CWQ60Row-goofish-search-scraper-logo.png" width="20" height="20" style="vertical-align:middle;border-radius:4px"> &nbsp;<a href="https://apify.com/zen-studio/goofish-xianyu-search-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">闲鱼搜索 Goofish</a></span><br>
<span style="color:#78716C;font-size:11px">二手商品 + 卖家资料</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-right:none;border-top:none;vertical-align:top;width:25%">
<span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/NWYsOG96fMDy8ycdf-actor-1vbpDShUjMFGaGcta-1fcx609tQN-goofish-search-scraper-logo.png" width="20" height="20" style="vertical-align:middle;border-radius:4px"> &nbsp;<a href="https://apify.com/zen-studio/goofish-xianyu-item-detail-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">闲鱼详情 Detail</a></span><br>
<span style="color:#78716C;font-size:11px">URL / ID 增强</span>
</td>
<td style="padding:10px 14px;border:1px solid #E7E5E4;border-radius:0 0 4px 0;border-top:none;vertical-align:top;width:25%">
<span style="white-space:nowrap"><img src="https://apify-image-uploads-prod.s3.us-east-1.amazonaws.com/NWYsOG96fMDy8ycdf-actor-2EHa8oEwBE1sDJaGb-tVMa2WLtpP-goofish-search-scraper-logo.png" width="20" height="20" style="vertical-align:middle;border-radius:4px"> &nbsp;<a href="https://apify.com/zen-studio/goofish-xianyu-seller-scraper" style="color:#1C1917;text-decoration:none;font-weight:700;font-size:13px">闲鱼卖家 Sellers</a></span><br>
<span style="color:#78716C;font-size:11px">卖家资料 + 评价</span>
</td>
</tr>
</table>

#### Copy to your AI assistant / 复制给你的 AI 助手

````

zen-studio/xigua-video-search-scraper on Apify. Scrapes Xigua (西瓜视频) search results with video metadata, author profiles, top-level comments, nested replies, and resolved playback URLs. Call ApifyClient("TOKEN").actor("zen-studio/xigua-video-search-scraper").call(run\_input={...}), then client.dataset(run\["defaultDatasetId"]).list\_items().items. Full spec: GET https://api.apify.com/v2/acts/zen-studio~xigua-video-search-scraper/builds/default (Bearer TOKEN) → inputSchema, actorDefinition.storages.dataset, readme. Token: https://console.apify.com/account/integrations

````

![Xigua Video Search Scraper](https://iili.io/B6fzzXI.png)

### 主要功能 Key Features

- **每视频 100+ 字段** — 元数据、封面、评论、回复、作者资料一次抓取 · 100+ fields per video with metadata, covers, comments, replies, and author profile
- **智能搜索类型** — 自动识别关键词与话题（`#美食`、`#新疆旅游`），也可强制指定 · Auto-detects hashtag vs keyword by `#` prefix, or force explicitly
- **三种排序 + 七档时长筛选** — 按相关度、最新、播放量排序；时长从 3 分钟内到 60 分钟以上共 6 档 · 3 sort modes × 7 duration buckets
- **可播放链接即时解析** — 搜索结果直接返回可用的视频 URL，无需额外请求 · Playback URLs resolved inline
- **无最低消费** — 按条付费，运行多少付多少，无月费 · Pay-per-event only, no monthly subscription required

### 如何抓取西瓜视频 How to Scrape Xigua Videos

#### 基础搜索 Basic — a single keyword

```json
{
    "queries": ["旅行"]
}
````

#### 多关键词批量 Multiple queries in one run

```json
{
    "queries": ["美食", "家常菜", "#减脂餐"],
    "maxResultsPerQuery": 50
}
```

#### 最新排序 + 时长筛选 Newest + 5–10 min videos

```json
{
    "queries": ["英语学习"],
    "sortBy": "newest",
    "duration": "5to10m",
    "maxResultsPerQuery": 100
}
```

#### 话题标签 + 完整评论与回复 Hashtag with full comments + replies

```json
{
    "queries": ["#搞笑", "#中文字幕"],
    "searchType": "hashtag",
    "maxResultsPerQuery": 30,
    "maxCommentsPerVideo": 50,
    "includeReplies": true,
    "maxRepliesPerComment": 50
}
```

### 输入参数 Input Parameters

| 参数 Parameter | 类型 Type | 默认 Default | 说明 Description |
|-----------|------|---------|-------------|
| `queries` | array | *required* | 搜索词列表，支持关键词和话题 · List of keywords or hashtags. Each query runs independently. |
| `searchType` | string | `auto` | `auto` / `keyword` / `hashtag`。auto 模式下 `#` 开头自动识别为话题 · Auto-detect by `#` prefix |
| `maxResultsPerQuery` | integer | `20` | 每个搜索词返回的最大视频数 (1–1000) · Max videos returned per query |
| `sortBy` | string | `relevance` | `relevance` 相关度 / `newest` 最新 / `mostPlayed` 播放量 · Native Xigua sort options |
| `duration` | string | `any` | `any` / `under3m` / `3to5m` / `5to10m` / `10to30m` / `30to60m` / `over60m` · Duration bucket filter |
| `includeComments` | boolean | `true` | 是否抓取评论（每条视频顶级评论） · Include top-level comments |
| `maxCommentsPerVideo` | integer | `50` | 每视频评论数上限（西瓜单页上限 50） · Max top-level comments per video |
| `includeReplies` | boolean | `false` | 是否抓取评论回复（增加请求量） · Fetch nested reply threads |
| `maxRepliesPerComment` | integer | `50` | 每条顶级评论的回复数上限 · Max replies per comment when `includeReplies` is on |

### 可抓取数据 What Data Can You Extract from Xigua (西瓜视频)?

每条视频结果包含以下字段组 / Every video row includes:

- **视频标识 Identity** — groupId, itemId, awemeId, videoId, gid, aggrType
- **基本信息 Metadata** — title 标题, abstract 简介, tag, sourceName 来源, mediaName, videoCategoryName 分类, publishTime + ISO, videoDurationSecs 时长
- **链接 URLs** — videoUrl (直接可访问的网页链接 · clean web URL), shareUrl (iesdouyin 分享链接), articleUrl, displayUrl
- **封面与图片 Images** — covers (多尺寸封面数组), firstFrameImageUrls, middleImageUrls, largeImageUrls, verticalImageUrls, detailVideoLargeImageUrls
- **统计数据 Stats** — playCount 播放量, diggCount 点赞, commentCount, shareCount, buryCount 踩, impressionCount, repinCount 收藏, danmakuCount 弹幕, videoLikeCount
- **作者资料 Author** — userId, name 昵称, description 简介, avatarUrl, followerCount 粉丝数 + 中文格式化, videoTotalCount, userVerified 认证, verifiedContent
- **播放信息 Playback** — `variants` (多清晰度直连 URL + 时长/码率/尺寸), posterUrl, coverUrl, autoDefinition, urlExpire (过期时间戳), hasEmbeddedSubtitle, subtitleInfos
- **评论 Comments** — 顶级评论数组 (嵌套于 `comments`) + 每条含 user (统一 profile 结构), text, aid, score, diggCount, replyCount, ipLabel (评论区IP地), hasAuthorDigg (作者是否点赞), publishLocInfo
- **回复 Replies** — 嵌套在 `comment.replies[]` 下, 与评论使用同一 user 字段结构 · Unified `user` schema across comments + replies (userId, nickname, avatarUrl, isVerified, signature, ipRegion, followerCount 等). 每条回复含 labelType (是否作者回复), contentType (文字/图片等), commentReplyTotal
- **相关搜索 Related search** — `relatedSearch: {title, wordId}` Xigua 在评论栏上方推的交叉搜索词
- **话题与章节 Tags** — hashtags, chapters, videoCategories (含 Chinese name path + IDs, 两种分类体系), activityLabel
- **搜索上下文 Search context** — query, searchType, searchId, queryId, rank, searchRank, pageOffset
- **内容状态标志 Flags** — isOriginal, isKeyVideo, isSubscribe, hasVideo, dxUpgradedVideo, suitableListening, downloadBlocked + downloadBlockedReason
- **增强状态 Enrichment status** — playbackResolved, commentsRequested, commentsResolved, commentsStoppedReason, repliesRequested, repliesResolved — 下游可追踪哪些字段成功拉取

#### 输出示例 Output Example

```json
{
  "entityType": "video",
  "query": "青岛沿海公交",
  "searchType": "keyword",
  "searchId": "202604242242129B3A9171EC0CB1A83698",
  "queryId": "6626894373793568004",
  "pageOffset": 0,
  "rank": 2,
  "searchRank": 0,
  "groupId": "7628596395083068132",
  "itemId": "7628596395083068132",
  "awemeId": "7628596395083068132",
  "videoId": "v0d00fg10000d7f3f1fog65l3vkqeqr0",
  "gid": "0",
  "aggrType": "1",
  "title": "来青岛 一定要去坐一次沿海公交 只是静静看着窗外 心就静了万分 ",
  "abstract": "来青岛 一定要去坐一次沿海公交 只是静静看着窗外 心就静了万分\n#青岛 #海边  #夏天 #旅行 #inmyfeelings",
  "tag": "",
  "sourceName": "-𝙓𝙤𝙤𝙝.𝙩𝙬𝙤2",
  "mediaName": "",
  "videoCategoryName": "旅行",
  "videoCategories": [
    {
      "source": "aweme",
      "version": 0,
      "path": [
        "旅游",
        "旅行摄影",
        "海景"
      ],
      "ids": [
        "2028",
        "2028003",
        "2028003002"
      ]
    },
    {
      "source": "aweme",
      "version": 1,
      "path": [
        "旅行",
        "旅行记录与分享",
        "旅行随拍"
      ],
      "ids": [
        "629",
        "62913",
        "6291302"
      ]
    }
  ],
  "activityLabel": null,
  "coverMainColor": "",
  "videoDurationSecs": 30,
  "publishTime": 1776171009,
  "publishTimeIso": "2026-04-14T12:50:09+00:00",
  "videoUrl": "https://www.ixigua.com/7628596395083068132",
  "shareUrl": "https://www.iesdouyin.com/xg/video/7628596395083068132/?app=video_article&timestamp=1777041732",
  "articleUrl": "",
  "displayUrl": "",
  "covers": [
    "https://p3-sign.douyinpic.com/tos-cn-i-0813c001/osdADGF3LIDsAyAAguAgfyEWpeQB9c0ANAAjOC~tplv-pk90l89vgd-cover-blur:864:486:90.jpeg?lk3s=9d3f5bff&x-expires=1792591200&x-signature=cyAr%2BQC6W63qYnJ5HZVUnelnAS4%3D&from=2638175231&se=false&biz_tag=aweme_cover_large_image_list&l=202604242242129B3A9171EC0CB1A83698",
    "... 9 more"
  ],
  "firstFrameImageUrls": [
    "https://p5-sign.douyinpic.com/tos-cn-p-0015/owY8DEaMTCcoredWQqUGHAgfBBa88vhA67gAeL~c5_1080x1920.jpeg?lk3s=9d3f5bff&x-expires=1792591200&x-signature=40Oq%2BFT11PwPj7OLcpijeD8YMbM%3D&from=2638175231&se=false&biz_tag=aweme_cover_first_frame_image&l=202604242242129B3A9171EC0CB1A83698",
    "... 2 more"
  ],
  "middleImageUrls": [
    "https://p3-sign.douyinpic.com/tos-cn-i-0813c001/osdADGF3LIDsAyAAguAgfyEWpeQB9c0ANAAjOC~tplv-pk90l89vgd-cover-blur:864:486:90.jpeg?lk3s=9d3f5bff&x-expires=1792591200&x-signature=cyAr%2BQC6W63qYnJ5HZVUnelnAS4%3D&from=2638175231&se=false&biz_tag=aweme_cover_large_image_list&l=202604242242129B3A9171EC0CB1A83698",
    "... 3 more"
  ],
  "largeImageUrls": [
    "https://p3-sign.douyinpic.com/tos-cn-i-0813c001/osdADGF3LIDsAyAAguAgfyEWpeQB9c0ANAAjOC~tplv-pk90l89vgd-cover-blur:864:486:90.jpeg?lk3s=9d3f5bff&x-expires=1792591200&x-signature=cyAr%2BQC6W63qYnJ5HZVUnelnAS4%3D&from=2638175231&se=false&biz_tag=aweme_cover_large_image_list&l=202604242242129B3A9171EC0CB1A83698",
    "... 3 more"
  ],
  "verticalImageUrls": [
    "https://p11-sign.douyinpic.com/tos-cn-i-0813c001/osdADGF3LIDsAyAAguAgfyEWpeQB9c0ANAAjOC~c5_640x840.jpeg?lk3s=9d3f5bff&x-expires=1792591200&x-signature=ZEu0Yuf9p9tzjVXKxZE74GSdImY%3D&from=2638175231&se=false&biz_tag=aweme_cover_vertical_image_list&l=202604242242129B3A9171EC0CB1A83698",
    "... 2 more"
  ],
  "detailVideoLargeImageUrls": [
    "https://p3-sign.douyinpic.com/tos-cn-i-0813c001/osdADGF3LIDsAyAAguAgfyEWpeQB9c0ANAAjOC~tplv-pk90l89vgd-cover-blur:864:486:90.jpeg?lk3s=9d3f5bff&x-expires=1792591200&x-signature=cyAr%2BQC6W63qYnJ5HZVUnelnAS4%3D&from=2638175231&se=false&biz_tag=aweme_cover_large_image_list&l=202604242242129B3A9171EC0CB1A83698",
    "... 3 more"
  ],
  "stats": {
    "playCount": 0,
    "commentCount": 2876,
    "diggCount": 127541,
    "buryCount": 0,
    "shareCount": 35838,
    "impressionCount": 0,
    "repinCount": 11729,
    "danmakuCount": 5,
    "videoLikeCount": 0
  },
  "author": {
    "userId": "61736189890",
    "awemeUserId": "0",
    "secUserId": null,
    "name": "-𝙓𝙤𝙤𝙝.𝙩𝙬𝙤2",
    "description": "",
    "avatarUrl": "https://p3.bdxiguaimg.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_d00756091bf12abb124e501c7fcf3473.jpeg?from=327834062",
    "followerCount": 714,
    "followerCountText": "714",
    "videoTotalCount": 8,
    "isLiving": false,
    "userVerified": null,
    "verifiedContent": null
  },
  "playback": {
    "resolved": true,
    "code": 0,
    "message": "success",
    "mediaType": "video",
    "videoDuration": 30.567,
    "urlExpire": 1777045365,
    "posterUrl": "https://p3-sign.douyinpic.com/tos-cn-p-0015/oAegagOsAA8XBfor7W86GTMCV3vPYQBdAzaL...",
    "coverUrl": null,
    "autoDefinition": "360p",
    "enableSsl": true,
    "enableAdaptive": false,
    "hasEmbeddedSubtitle": false,
    "subtitleInfos": null,
    "variants": "[{definition, url, width, height, bitrate, size, codec, format, urlExpire, ...}, ...3 quality tiers]"
  },
  "hashtags": [],
  "chapters": [],
  "relatedSearch": {
    "title": "青岛沿海公交路线",
    "wordId": "6862662378366981390"
  },
  "comments": [
    {
      "entityType": "comment",
      "kind": "comment",
      "aid": "1128",
      "sourceApp": "Xigua",
      "commentId": "7628885797529977637",
      "parentCommentId": null,
      "text": "",
      "mentions": [],
      "createTime": 1776238393,
      "createTimeIso": "2026-04-15T07:33:13+00:00",
      "source": null,
      "score": 4462.1776238393,
      "diggCount": 4463,
      "buryCount": 7,
      "forwardCount": 0,
      "replyCount": 105,
      "publishLocInfo": "",
      "membershipStatus": 0,
      "largeImageUrls": [],
      "thumbImageUrls": [],
      "hasMultiMedia": false,
      "multiMedia": null,
      "tags": null,
      "voteInfo": null,
      "hasAuthorDigg": 0,
      "isPgcAuthor": 0,
      "isRepost": false,
      "user": {
        "userId": "62912973704",
        "secUserId": null,
        "shortId": null,
        "nickname": "头条用户",
        "signature": null,
        "avatarUrl": "http://p3.toutiaoimg.com/thumb/2171/6003290650",
        "isVerified": false,
        "verifiedReason": null,
        "followerCount": null,
        "followingCount": null,
        "ipRegion": null
      },
      "replies": [
        {
          "entityType": "comment",
          "kind": "reply",
          "commentId": "7628886880452805439",
          "parentCommentId": "7628885797529977637",
          "replyToReplyId": "0",
          "replyToUsername": null,
          "replyToUserId": null,
          "replyToUserSecId": null,
          "awemeId": "7628596395083068132",
          "text": "就这样淡淡地幸福下去吧",
          "textExtra": [],
          "createTime": 1776238645,
          "createTimeIso": "2026-04-15T07:37:25+00:00",
          "diggCount": 332,
          "status": 1,
          "ipLabel": "山东",
          "labelType": 1,
          "isAuthorDigged": false,
          "isHot": false,
          "canShare": true,
          "contentType": 1,
          "isFolded": false,
          "commentReplyTotal": 105,
          "user": {
            "userId": "61736189890",
            "secUserId": "MS4wLjABAAAAQSks8bQfZxETlQxDktAEZztLnDnYiSZlWDLWb0eTac4",
            "shortId": "22477734",
            "nickname": "-𝙓𝙤𝙤𝙝.𝙩𝙬𝙤2",
            "signature": "我们已经在过想要的一切",
            "avatarUrl": null,
            "isVerified": true,
            "verifiedReason": null,
            "followerCount": 0,
            "followingCount": 0,
            "ipRegion": "CN"
          },
          "imageUrls": []
        },
        "... 2 more replies returned"
      ]
    },
    "... 9 more comments returned"
  ],
  "hasVideo": true,
  "isOriginal": false,
  "isKeyVideo": false,
  "isSubscribe": false,
  "isCutOrQuickWatchVideo": false,
  "isXgHasPlayletControl": false,
  "dxUpgradedVideo": false,
  "suitableListening": false,
  "downloadBlocked": true,
  "downloadBlockedReason": "暂不支持下载",
  "enrichmentStatus": {
    "playbackResolved": true,
    "playbackError": null,
    "commentsRequested": true,
    "commentsResolved": true,
    "commentsStoppedReason": null,
    "commentsError": null,
    "repliesRequested": true,
    "repliesResolved": true,
    "repliesStoppedReason": null,
    "repliesError": null
  }
}
```

> 以上包含每条记录的全部顶层字段。大型数组（covers、图集、变体、评论等）用 `... N more` 标注，实际数据集里完整返回；嵌套结构在 Apify Console 表格里展平为 100+ 列。<br>Above shows all top-level fields of each record. Large arrays use `... N more` markers — full content is in the actual dataset. Nested objects flatten to 100+ columns in the Apify Console table view.

### 高级用法 Advanced Usage

#### 只抓元数据不要评论 Metadata-only (skip comments to save cost)

```json
{
    "queries": ["美食"],
    "maxResultsPerQuery": 200,
    "includeComments": false
}
```

#### 话题全量 + 回复 Full hashtag crawl with nested replies

```json
{
    "queries": ["#新疆旅游"],
    "searchType": "hashtag",
    "maxResultsPerQuery": 500,
    "maxCommentsPerVideo": 50,
    "includeReplies": true,
    "maxRepliesPerComment": 30
}
```

#### 抓取热门长视频 Trending long-form videos

```json
{
    "queries": ["纪录片"],
    "sortBy": "mostPlayed",
    "duration": "30to60m",
    "maxResultsPerQuery": 100,
    "includeComments": false
}
```

#### 多条查询 + 输出进评论数据库 Multiple queries, stream into a comments dataset

```json
{
    "queries": ["学编程", "学英语", "学设计"],
    "sortBy": "newest",
    "maxResultsPerQuery": 50,
    "includeComments": true,
    "maxCommentsPerVideo": 20
}
```

### 价格 Pricing — Pay Per Event (PPE)

按条付费，只为实际返回的视频和评论付费。订阅用户自动享受阶梯折扣。Pay only for what's returned. Subscription tiers get automatic step-down discounts on the video event.

| 事件 Event | Free | Starter | Scale | Business |
|---|---|---|---|---|
| 视频 Video (per 1,000) | **$14.99** | $14.99 | $13.99 | $12.99 |
| 评论/回复 Comment/Reply (per 1,000) | **$3.99** | $3.99 | $3.99 | $3.99 |

Scale 和 Business 订阅用户在视频事件上自动享受阶梯折扣。Scale and Business subscribers get automatic step-down discounts on the video event.

#### 降低成本的几种方法 Cost optimization

- **关闭评论 Disable comments** — `includeComments: false` 仅抓取元数据和播放链接，每视频约 $0.014 · Metadata-only at ~$0.014/video
- **降低评论数 Lower `maxCommentsPerVideo`** — 只要前 10 条顶级评论可把评论成本减至 20% · Only top 10 comments cuts that cost 80%
- **用筛选器缩小范围 Narrow via filters** — `duration` 与 `sortBy` 配合可大幅减少无关结果 · Tighter filters = fewer wasted charges

### 常见问题 FAQ

**可以抓取多少条视频？How many videos per run?**<br>
单次搜索词上限 1,000 条视频（input schema 硬顶）。西瓜服务端对单个关键词的可分页深度通常在 500 条左右，达到深度后 `has_more` 自动为 false，actor 会自然结束。Upper cap is 1,000 per query; Xigua's server-side depth is typically ~500 for popular queries.

**数据是否实时？Is the data live?**<br>
是。每次运行都会最新抓取，不读缓存。播放链接带 `urlExpire` 时间戳，通常有效期 10 分钟以上。Real-time. Playback URLs come with an `urlExpire` timestamp (typically 10+ minutes valid).

**支持中文关键词吗？Does it support Chinese keywords?**<br>
完全支持。西瓜视频本身就是中文平台，关键词如 `旅行`、`美食`、`新疆旅游攻略` 都能直接使用。支持 `#` 开头的话题搜索。Full Chinese keyword support — it's a CN-native platform.

**评论和回复是怎么关联的？How are comments and replies linked?**<br>
评论嵌套在视频行的 `comments` 数组里；每条顶级评论的 `replies` 是该评论下的回复数组（仅当 `includeReplies: true` 时存在）。每条评论都有 `commentId` 和 `parentCommentId`（回复时指向父评论）。Comments are nested inside the video row; replies are nested inside each comment when enabled.

**播放链接能直接播放吗？Can I play the video URLs directly?**<br>
可以。`playback.variants` 数组里每一档清晰度都带有可直接 HTTP GET 播放的 URL，无需额外请求。URL 会在 `urlExpire` 后失效，重新跑一次即可刷新。Yes — each variant URL is directly playable. Refresh by re-running when `urlExpire` hits.

**为什么 playCount 经常是 0？Why is playCount often 0?**<br>
西瓜视频对搜索结果的 `playCount` 字段做了脱敏处理，只有少部分热门视频会返回真实播放量。`diggCount` 和 `commentCount` 是可靠的热度指标。Xigua masks `playCount` in search results — use `diggCount` + `commentCount` for engagement signals.

**能按作者或分类搜索吗？Can I search by author or category?**<br>
本 actor 仅支持关键词与话题搜索（对应西瓜 App 的搜索框）。如需按作者或频道抓取，请提 feature request。This actor covers keyword + hashtag search only; author/channel coverage on request.

**视频 URL 能下载吗？Can I download the video file?**<br>
技术上可以（URL 直连视频 CDN），但请遵守平台服务条款和原作者版权。返回字段中的 `banDownload` 标记了作者是否允许下载。Technically yes, but respect Xigua ToS + creator copyright. `banDownload=1` means the author has disabled downloads.

**结果里混有 Douyin 抖音推广卡片是什么？What are the Douyin promo cards in results?**<br>
西瓜搜索会在结果顶部插入 1–2 条抖音小程序推广卡片。actor 自动过滤，只保留真实视频结果。Xigua embeds Douyin cross-promo cards at the top of search results; the actor filters them out automatically.

**多次跑同一个查询结果会变吗？Do results change between runs?**<br>
会。相关度排序依赖实时推荐，同一关键词每次跑的前几条可能略有不同。`newest` 与 `mostPlayed` 排序更稳定。Yes — relevance sort shifts. Use `newest` or `mostPlayed` for more stable ordering across runs.

**能试跑一下再付费吗？Can I test before paying?**<br>
可以。Apify 免费订阅无月费，按本 actor 的 PPE 计费；前几次用小 `maxResultsPerQuery`（例如 10）即可以很低成本验证输出。Yes. Apify's Free subscription has no monthly fee, pay only the PPE rate. Start with a small `maxResultsPerQuery` (e.g. 10) for cheap validation.

**支持代理 / 地区限制吗？Do I need to configure a proxy?**<br>
不需要。Actor 内置住宅 IP 池自动处理地区限制。No — residential proxy is bundled.

### 支持 Support

- **Bug 反馈 Bugs**: Issues tab
- **功能需求 Feature requests**: Issues tab

### 法律合规 Legal Compliance

仅抓取公开数据。使用本 actor 须遵守西瓜视频服务条款及 GDPR / CCPA 等数据保护法规，不得用于侵犯版权或骚扰用户。<br>
Extracts publicly available data only. You must comply with Xigua's Terms of Service and applicable data-protection regulations (GDPR, CCPA). Do not use this actor for copyright infringement or user harassment.

***

*西瓜视频搜索爬虫 · 关键词、话题、评论、回复、播放链接一次抓取。Xigua Video Search Scraper — keywords, hashtags, comments, replies, and playback URLs in one run.*

# Actor input Schema

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

Add one or more plain keywords or hashtags. Each query runs as a separate search.<br><br><b>Examples:</b><br>• Keyword: <code>旅行</code>, <code>美食</code>, <code>英语学习</code><br>• Hashtag (with <code>#</code>): <code>#中文字幕</code>, <code>#搞笑</code><br><br>Direct Xigua video URLs are <b>not</b> supported — use the keyword that brings up the video on the app.

## `searchType` (type: `string`):

How queries are interpreted:<br><br>• <b>Auto</b> — queries starting with <code>#</code> run as hashtag searches, everything else as keyword search. Works for most cases.<br>• <b>Keyword</b> — forces keyword search even for <code>#</code>-prefixed queries.<br>• <b>Hashtag</b> — forces hashtag search regardless of <code>#</code> prefix.

## `maxResultsPerQuery` (type: `integer`):

Maximum number of videos to return per query. Higher values cost more — we recommend starting with <b>10</b> to preview the output, then raising for real runs.<br><br>Xigua's search typically has a practical depth of several hundred results per popular query before repeating.

## `sortBy` (type: `string`):

How search results are ordered. Matches the filter options inside the Xigua app.<br><br>• <b>Relevance</b> — default ranking, mixes popular and recent videos the algorithm thinks match your query best.<br>• <b>Newest</b> — sort by publish time, newest first. Useful for tracking fresh content on a topic.<br>• <b>Most played</b> — sort by play count, highest first. Surfaces already-viral content.

## `duration` (type: `string`):

Filter results by video length. Matches the native Xigua duration buckets:<br><br>• <b>< 3 min</b> — shorts and quick clips<br>• <b>3–5 min</b> — typical short-form entertainment<br>• <b>5–10 min</b> — standard informational or vlog content<br>• <b>10–30 min</b> — long-form video essays<br>• <b>30–60 min</b> / <b>> 60 min</b> — full episodes or live recaps<br><br>Leave as <b>Any</b> to include all durations.

## `includeComments` (type: `boolean`):

Include top-level comments for each video. Enabled by default because most users want comment data.<br><br>Disable for metadata-only runs to reduce cost.

## `maxCommentsPerVideo` (type: `integer`):

Number of top-level comments to include per video (up to <b>500</b>). Lower values reduce cost; raise for deeper comment coverage on viral videos.<br><br>Set to <code>0</code> to skip comments even when the toggle above is on.

## `includeReplies` (type: `boolean`):

Fetch full reply threads for comments that have replies. <b>Disabled by default</b> because it meaningfully increases request count.<br><br>Enable when you need nested conversation data; leave off for simpler analysis.

## `maxRepliesPerComment` (type: `integer`):

Maximum number of replies to include for each top-level comment when replies are enabled (up to <b>500</b>). Raise for deeper reply coverage on popular comments.

## Actor input object example

```json
{
  "queries": [
    "旅行"
  ],
  "searchType": "auto",
  "maxResultsPerQuery": 10,
  "sortBy": "relevance",
  "duration": "any",
  "includeComments": true,
  "maxCommentsPerVideo": 20,
  "includeReplies": false,
  "maxRepliesPerComment": 20
}
```

# Actor output Schema

## `videos` (type: `string`):

Dataset containing Xigua video rows with playback, comments, replies, and raw payload blocks.

# 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": [
        "旅行"
    ],
    "maxResultsPerQuery": 10,
    "maxCommentsPerVideo": 20,
    "maxRepliesPerComment": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("zen-studio/xigua-video-search-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": ["旅行"],
    "maxResultsPerQuery": 10,
    "maxCommentsPerVideo": 20,
    "maxRepliesPerComment": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("zen-studio/xigua-video-search-scraper").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 '{
  "queries": [
    "旅行"
  ],
  "maxResultsPerQuery": 10,
  "maxCommentsPerVideo": 20,
  "maxRepliesPerComment": 20
}' |
apify call zen-studio/xigua-video-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=zen-studio/xigua-video-search-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Xigua 西瓜视频 Search Scraper - Keyword + Comments + MP4 下载",
        "description": "Search Xigua (西瓜视频) by keyword or hashtag — up to 1,000 videos with title, author, engagement stats, 1080p/720p/480p MP4 download URLs, hashtags, covers, optional comments and replies. Cross-app linkage to Douyin (抖音). 西瓜视频下载 / 爬虫.",
        "version": "0.0",
        "x-build-id": "Ekk0AurEZrUxnnhlK"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/zen-studio~xigua-video-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-zen-studio-xigua-video-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/zen-studio~xigua-video-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-zen-studio-xigua-video-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/zen-studio~xigua-video-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-zen-studio-xigua-video-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "queries"
                ],
                "properties": {
                    "queries": {
                        "title": "搜索词 / Search queries",
                        "type": "array",
                        "description": "Add one or more plain keywords or hashtags. Each query runs as a separate search.<br><br><b>Examples:</b><br>• Keyword: <code>旅行</code>, <code>美食</code>, <code>英语学习</code><br>• Hashtag (with <code>#</code>): <code>#中文字幕</code>, <code>#搞笑</code><br><br>Direct Xigua video URLs are <b>not</b> supported — use the keyword that brings up the video on the app.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "searchType": {
                        "title": "搜索类型 / Search type",
                        "enum": [
                            "auto",
                            "keyword",
                            "hashtag"
                        ],
                        "type": "string",
                        "description": "How queries are interpreted:<br><br>• <b>Auto</b> — queries starting with <code>#</code> run as hashtag searches, everything else as keyword search. Works for most cases.<br>• <b>Keyword</b> — forces keyword search even for <code>#</code>-prefixed queries.<br>• <b>Hashtag</b> — forces hashtag search regardless of <code>#</code> prefix.",
                        "default": "auto"
                    },
                    "maxResultsPerQuery": {
                        "title": "每个搜索词最大结果数 / Max results per query",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of videos to return per query. Higher values cost more — we recommend starting with <b>10</b> to preview the output, then raising for real runs.<br><br>Xigua's search typically has a practical depth of several hundred results per popular query before repeating.",
                        "default": 20
                    },
                    "sortBy": {
                        "title": "排序 / Sort by",
                        "enum": [
                            "relevance",
                            "newest",
                            "mostPlayed"
                        ],
                        "type": "string",
                        "description": "How search results are ordered. Matches the filter options inside the Xigua app.<br><br>• <b>Relevance</b> — default ranking, mixes popular and recent videos the algorithm thinks match your query best.<br>• <b>Newest</b> — sort by publish time, newest first. Useful for tracking fresh content on a topic.<br>• <b>Most played</b> — sort by play count, highest first. Surfaces already-viral content.",
                        "default": "relevance"
                    },
                    "duration": {
                        "title": "时长 / Duration",
                        "enum": [
                            "any",
                            "under3m",
                            "3to5m",
                            "5to10m",
                            "10to30m",
                            "30to60m",
                            "over60m"
                        ],
                        "type": "string",
                        "description": "Filter results by video length. Matches the native Xigua duration buckets:<br><br>• <b>< 3 min</b> — shorts and quick clips<br>• <b>3–5 min</b> — typical short-form entertainment<br>• <b>5–10 min</b> — standard informational or vlog content<br>• <b>10–30 min</b> — long-form video essays<br>• <b>30–60 min</b> / <b>> 60 min</b> — full episodes or live recaps<br><br>Leave as <b>Any</b> to include all durations.",
                        "default": "any"
                    },
                    "includeComments": {
                        "title": "包含评论 / Include comments",
                        "type": "boolean",
                        "description": "Include top-level comments for each video. Enabled by default because most users want comment data.<br><br>Disable for metadata-only runs to reduce cost.",
                        "default": true
                    },
                    "maxCommentsPerVideo": {
                        "title": "每个视频最多评论数 / Max comments per video",
                        "minimum": 0,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Number of top-level comments to include per video (up to <b>500</b>). Lower values reduce cost; raise for deeper comment coverage on viral videos.<br><br>Set to <code>0</code> to skip comments even when the toggle above is on.",
                        "default": 50
                    },
                    "includeReplies": {
                        "title": "包含回复 / Include replies",
                        "type": "boolean",
                        "description": "Fetch full reply threads for comments that have replies. <b>Disabled by default</b> because it meaningfully increases request count.<br><br>Enable when you need nested conversation data; leave off for simpler analysis.",
                        "default": false
                    },
                    "maxRepliesPerComment": {
                        "title": "每条评论最多回复数 / Max replies per comment",
                        "minimum": 0,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of replies to include for each top-level comment when replies are enabled (up to <b>500</b>). Raise for deeper reply coverage on popular comments.",
                        "default": 50
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
