# Xigua Video Scraper - 西瓜视频 Search, Channels & Comments (`seemuapps/xigua-video-scraper`) Actor

Scrape Xigua Video (西瓜视频): keyword search results, every video on a channel with views, likes, comments and shares, and video comments with likes.

- **URL**: https://apify.com/seemuapps/xigua-video-scraper.md
- **Developed by:** [Seemu Scraping](https://apify.com/seemuapps) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 92.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 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.

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

## Xigua Video Scraper - 西瓜视频 Search, Channels & Comments

Scrape Xigua Video (西瓜视频, ByteDance's long-form video platform, also shown inside Toutiao 今日头条) without a login. Search videos by keyword, export every video a creator has posted with views, likes, comments, shares and saves, or collect the top comments on any video with likes, replies and commenter IP location. Export to JSON, CSV, Excel or Google Sheets.

### What you get

**Keyword search and channel videos** — one row per video (`rowType: "video"`):

- **Video**: video ID, title, description, URL, cover image, duration and publish time
- **Engagement**: views, likes, comments, shares, saves (favorites) and danmaku (bullet comments) on channel videos
- **Details**: category, IP location, original-content flag and pinned flag
- **Creator**: name, user ID, profile URL, avatar, follower count, verification and total video count

Search results include title, cover, duration, publish time, comment count and creator. Turn on **Add likes and creator followers** to also get likes, danmaku, saves, IP location and the creator's followers for each result.

**Video comments** — one row per comment (`rowType: "comment"`):

- Comment text, likes, reply count, time and IP location (省份)
- Commenter name, user ID, profile URL, avatar and verification, plus whether the comment is from the video's creator

### Use cases

- **China market research**: see which videos and creators lead a topic, product or industry on Xigua and Toutiao
- **Influencer discovery and vetting**: export a creator's full video history with views and engagement to judge reach and consistency
- **Competitor monitoring**: track what rival brands and channels publish and how each video performs
- **Audience feedback and sentiment analysis**: collect top comments with likes and regional IP location
- **Content strategy**: compare titles, lengths and engagement of the best-performing long-form videos

### How to use

1. Choose a **Mode**: Keyword search, Channel videos or Video comments
2. Fill in the matching list:
   - **Search keywords**, e.g. 汽车评测, 王者荣耀 (Chinese keywords give the best results)
   - **Channels**: profile URLs like `https://www.ixigua.com/home/52712347586` or numeric user IDs
   - **Videos**: URLs like `https://www.ixigua.com/7307902566032114187`, `m.ixigua.com/video/…` and Toutiao video links, or numeric video IDs
3. Set **Max results per keyword, channel or video** (0 = as many as available)
4. Run the actor and export from the **Dataset** tab

#### Getting more results (pagination)

Each run stops at your max results. To continue a keyword, channel or video where the last run stopped:

After the run finishes, open the **Key-value store** tab → copy the `NEXT_PAGE_ID` value → paste it into **Page ID** on your next run (same mode and same input). If `NEXT_PAGE_ID` is `null` or missing, you've fetched everything. With several inputs, `NEXT_PAGE_ID` continues the input the run was cut short in; for deep pagination, run one keyword, channel or video at a time.

### Output example

Channel video:

```json
{
  "rowType": "video",
  "videoId": "7323614735999042086",
  "url": "https://www.ixigua.com/7323614735999042086",
  "title": "守护最好的靳东男神",
  "coverUrl": "https://p3-sign.bdxiguaimg.com/tos-cn-i-0026/oYLAA0aBDIAVEA8NKxtpiNAR0QhMdBzCyEX0Af~tplv-pk90l89vgd-crop-center:864:486.webp?…",
  "durationSeconds": 58,
  "publishedAt": "2024-01-13T16:05:32.000Z",
  "views": 895,
  "likes": 32,
  "comments": 3,
  "shares": 0,
  "saves": 2,
  "danmaku": 0,
  "category": "音乐",
  "isOriginal": false,
  "isPinned": false,
  "ipLocation": "广东",
  "authorName": "冷月月",
  "authorId": "1922379661976311",
  "authorUrl": "https://www.ixigua.com/home/1922379661976311",
  "authorFollowers": 1753,
  "authorVerified": false,
  "authorVideoCount": 94,
  "source": "channel",
  "query": "1922379661976311",
  "rank": 1
}
```

Comment:

```json
{
  "rowType": "comment",
  "commentId": "7307963281841586978",
  "videoId": "7307902566032114187",
  "videoUrl": "https://www.ixigua.com/7307902566032114187",
  "text": "请不要再唱《新东方红》！",
  "likes": 319,
  "replyCount": 37,
  "createdAt": "2023-12-02T11:50:05.000Z",
  "ipLocation": "吉林",
  "isByVideoAuthor": false,
  "authorName": "刘老奤",
  "authorId": "89923320145",
  "authorUrl": "https://www.ixigua.com/home/89923320145",
  "source": "comments",
  "rank": 2
}
```

### FAQ

**Do I need a Xigua or Toutiao account?** No.

**Why do search results have no view counts?** Xigua's search results don't include them. Channel mode returns views for every video, and **Add likes and creator followers** adds likes and follower counts to search results.

**Why did a search return fewer videos than I asked for?** Xigua search returns only a handful of videos per page and runs out quickly for niche keywords; some keywords return nothing at all. Try several related keywords, or use Channel mode to get a creator's complete video list.

**Which comments do I get?** Top comments in Xigua's own ranking (most liked and most replied first).

**What is danmaku?** Bullet comments that fly across the video while it plays.

# Actor input Schema

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

What to scrape. 'Keyword search' returns Xigua videos matching your keywords. 'Channel videos' returns every video a creator has posted, newest first, with views, likes, comments and shares. 'Video comments' returns the top comments on the videos you list.

## `keywords` (type: `array`):

Search terms, one per line, e.g. 王者荣耀, 汽车评测 or 纪录片. Chinese keywords give the best results. Used in 'Keyword search' mode.

## `addVideoStats` (type: `boolean`):

Look up each search result to add its likes, danmaku (bullet comments), saves, IP location, original flag and the creator's follower and video counts. Billed as an extra event per video. Used in 'Keyword search' mode.

## `channels` (type: `array`):

Xigua creator profile URLs (https://www.ixigua.com/home/<id>) or numeric user IDs, one per line. Toutiao user URLs with a numeric ID also work. Used in 'Channel videos' mode.

## `videos` (type: `array`):

Xigua video URLs (https://www.ixigua.com/<id>, m.ixigua.com/video/<id>), Toutiao video links or numeric video IDs, one per line. Used in 'Video comments' mode.

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

Maximum number of rows to return for each keyword, channel or video. Set 0 to collect as many as available.

## `pageId` (type: `string`):

Paste NEXT_PAGE_ID from the previous run's Key-value store to continue where it stopped. Keep the same mode and input list.

## Actor input object example

```json
{
  "mode": "channel",
  "keywords": [
    "王者荣耀"
  ],
  "addVideoStats": false,
  "channels": [
    "https://www.ixigua.com/home/52712347586"
  ],
  "videos": [
    "https://www.ixigua.com/7307902566032114187"
  ],
  "maxItems": 50
}
```

# Actor output Schema

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

One row per video (rowType 'video') in search and channel modes, or one row per comment (rowType 'comment') in comments mode.

## `nextPageId` (type: `string`):

NEXT_PAGE_ID record in the default key-value store. Paste into Page ID on the next run to resume; null when the list is exhausted.

# 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 = {
    "mode": "channel",
    "keywords": [
        "王者荣耀"
    ],
    "channels": [
        "https://www.ixigua.com/home/52712347586"
    ],
    "videos": [
        "https://www.ixigua.com/7307902566032114187"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("seemuapps/xigua-video-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 = {
    "mode": "channel",
    "keywords": ["王者荣耀"],
    "channels": ["https://www.ixigua.com/home/52712347586"],
    "videos": ["https://www.ixigua.com/7307902566032114187"],
}

# Run the Actor and wait for it to finish
run = client.actor("seemuapps/xigua-video-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 '{
  "mode": "channel",
  "keywords": [
    "王者荣耀"
  ],
  "channels": [
    "https://www.ixigua.com/home/52712347586"
  ],
  "videos": [
    "https://www.ixigua.com/7307902566032114187"
  ]
}' |
apify call seemuapps/xigua-video-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,seemuapps/xigua-video-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/Me8geV4bBZdA9VcjP/builds/1Gr4IYrma1yP2b1uR/openapi.json
