# Kuaishou Video & Comment Scraper (`stackrelay/kuaishou-scraper`) Actor

Extract public Kuaishou (快手 / Kwai) video metadata and comments by URL or photo ID. Granular pay-per-event pricing — pay for video details and comments separately.

- **URL**: https://apify.com/stackrelay/kuaishou-scraper.md
- **Developed by:** [StackRelay](https://apify.com/stackrelay) (community)
- **Categories:** Videos, SEO tools
- **Stats:** 5 total users, 4 monthly users, 97.4% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## Kuaishou & Kwai Scraper — Videos, Comments, Profiles, Search

Extract public **Kuaishou (快手 / Kwai)** data — built for brand/KOL-marketing agencies, e-commerce sellers tracking live-shopping creators, and China-focused social-listening teams. Granular **pay-per-event** pricing: you pay only for the record types you pull.

### What it does

Provide any combination of three inputs:

- **`videoUrls`** — video metadata (caption, author, view/like counts, duration, tags, cover & video URLs), plus optional **comments** (author, text, likes, reply flag, timestamp).
- **`userProfiles`** — a Kwai creator's profile (name, bio, fan/follow/video counts, verification) plus their videos.
- **`searchTerms`** — keyword search, returning matching videos.

Every operation runs **anonymously — no login or cookie required.**

> **How it gets the data.** Video detail comes from Kuaishou's server-rendered page (fast). Comments are captcha-walled for plain HTTP clients, so the actor loads the real page in a headless browser and captures the page's own *signed* comment requests — no captcha solving. **Profiles** are fetched from Kwai (Kuaishou's international brand), which server-renders profile + video data. **Search** uses Kwai's REST API on an anonymous visitor session. Residential proxies are required throughout.

### Example input

```json
{
    "videoUrls": [
        "https://www.kuaishou.com/short-video/3xf8enef8rg4hkc",
        "3xnzvbtkx9xefpa"
    ],
    "includeComments": true,
    "maxCommentsPerVideo": 200,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": ["RESIDENTIAL"]
    }
}
```

### Example output

Records are pushed to one dataset with a `record_type` field (`video` or `comment`). The dataset has two pre-built views — **Videos** and **Comments** — so you can export each cleanly.

A **video** record:

```json
{
    "record_type": "video",
    "id": "3xq6vcny33w5ffm",
    "source_url": "https://www.kuaishou.com/short-video/3xq6vcny33w5ffm",
    "caption": "话糙理不糙！馆长怒批…",
    "author_id": "3xtszwcjndjy5ek",
    "author_name": "中国新闻社",
    "view_count": "17万",
    "like_count": 9161,
    "duration_ms": 31480,
    "video_ratio": 0.5625,
    "cover_url": "https://p2.a.yximgs.com/...",
    "video_url": "https://v4.oskwai.com/....mp4",
    "tags": ["时事"],
    "published_at": "2026-06-09T14:38:58+00:00",
    "scraped_at": "2026-06-15T09:12:00+00:00"
}
```

A **comment** record:

```json
{
    "record_type": "comment",
    "id": "1142338051659",
    "video_id": "3xxuh8kmqmkkm2k",
    "author_id": "3xpxafb3faju7y9",
    "author_name": "程秀海567",
    "content": "好听[爱心][爱心][爱心]",
    "like_count": 1,
    "reply_count": null,
    "has_replies": false,
    "commented_at": "2026-06-16T05:46:02+00:00",
    "scraped_at": "2026-06-16T23:42:00+00:00"
}
```

Field notes:

- `id` is stable across runs — use it to deduplicate on your side.
- `like_count` prefers the real (un-rounded) count when Kuaishou exposes it.
- `view_count` is Kuaishou's localized **display string** (e.g. `"17万"` = 170k), not an integer — the web surface does not expose a raw view integer.
- Any field can be `null` when Kuaishou omits it for a given video.
- Timestamps are ISO-8601 UTC.

### Pricing — pay-per-event

You pay only for what each run produces. Set these prices in the Apify Console under **Monetization → Pay per event**:

| Event | Price (USD) | Charged when |
|---|---|---|
| `actor-start` | $0.001 | Once per run (low by design — no surprise base fee) |
| `video-detail` | $0.006 | Per video record returned |
| `comment` | $0.003 | Per comment record returned |
| `user-profile` | $0.006 | Per creator profile (via Kwai, no login) |
| `user-video` | $0.002 | Per video in a creator's catalog (via Kwai, no login) |
| `search-result` | $0.002 | Per search-result video (via Kwai, no login) |

Pricing is benchmarked against the Kuaishou/Kwai actors on the Apify Store: the budget incumbents charge ~$0.002–0.003 per flat result, while the premium full-feature competitor charges ~$0.01 per video detail and ~$0.002–0.004 for bulk rows (comments, search, catalog). This actor sits in between — cheaper than the premium option, with higher reliability than the budget ones. A typical run of 1 video + 100 comments costs about **$0.31**.

### Limitations

- **Public content only.** Private, age-gated, or removed videos return nothing for that ID (logged, not billed).
- **Residential proxies required.** Both the video page and the headless-browser comment fetch need residential IPs — datacenter IPs are blocked. Residential is the prefilled default. The browser uses a sticky session so all its connections share one IP.
- **Comments need the browser path.** When comments are enabled the actor launches a headless browser (heavier and slower than metadata-only runs — budget ~60–90s per video). Video-only runs (comments off) use a fast, lightweight HTTP path.
- **Profiles & search use Kwai, not kuaishou.com.** Kuaishou's own web profile/search routes are login-walled, so both are served via **Kwai** (Kuaishou's international brand, same backend), anonymously. For profiles, provide a Kwai handle or `www.kwai.com/@handle` URL. Note Kwai's catalog is international and overlaps with — but isn't identical to — China-domestic Kuaishou; some China-only creators may not be present.
- **Comment depth.** Only root (top-level) comments are returned; whether a comment has replies is flagged by `has_replies`. Nested replies are not expanded in v1.
- **Schema drift.** Kuaishou changes its internal data schema periodically (it recently moved comments to `rootCommentsV2`); parsers accept both old and new shapes and degrade gracefully to `null` rather than crash. Checked monthly.

### FAQ

**Where do I find a video's photo ID?** It's the last segment of the URL, e.g. `https://www.kuaishou.com/short-video/<photoId>`. You can paste the full URL or just the ID.

**Can I scrape comments without video details?** Each video you list is fetched for its detail record first; set `includeComments: false` for cheap metadata-only runs.

**Can I run this on a schedule?** Yes — use Apify's Schedules feature to re-pull a creator's videos or monitor comment growth over time.

**Which proxy should I use?** Residential (the prefilled default). Switch groups if you start seeing empty results.

**How do I export to my DB / Google Sheets?** Use Apify Integrations or the Dataset API. Every field above is available via `/items?format=json|csv|xlsx`, and the **Videos** / **Comments** views split the two record types for you.

# Actor input Schema

## `videoUrls` (type: `array`):

Kuaishou video URLs (e.g. https://www.kuaishou.com/short-video/3xabc...) or raw photo IDs. Each produces a video-detail record (and comments, if enabled).

## `userProfiles` (type: `array`):

Kwai creator handles or profile URLs (e.g. https://www.kwai.com/@oscaicos or just 'oscaicos'). Returns the creator's profile (fans, follows, video count, bio, verification) plus their videos — fetched anonymously via Kwai, no login/cookie needed.

## `searchTerms` (type: `array`):

Keywords to search for videos (via Kwai, anonymously — no login needed). Supports Chinese, English, and mixed queries. Each returns matching videos as search-result records.

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

If enabled, the actor also extracts comments for each video. Comments are billed separately (they are the hard, high-value extraction). Disable for cheaper metadata-only runs.

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

Hard cap on comments fetched per video. Protects you from unbounded runs on viral videos. Ignored when 'Scrape comments' is off.

## `maxVideosPerProfile` (type: `integer`):

Hard cap on videos returned per creator profile.

## `maxResultsPerSearch` (type: `integer`):

Hard cap on videos returned per search keyword.

## `cookie` (type: `string`):

Optional raw Cookie header. Not required — all operations work anonymously. Supplying a valid session can improve reliability if you hit rate limits.

## `proxyConfiguration` (type: `object`):

Kuaishou is a Chinese platform with real anti-bot measures. Residential proxies are strongly recommended; datacenter IPs are frequently blocked.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.kuaishou.com/short-video/3xq6vcny33w5ffm"
  ],
  "userProfiles": [
    "https://www.kwai.com/@oscaicos"
  ],
  "includeComments": true,
  "maxCommentsPerVideo": 100,
  "maxVideosPerProfile": 30,
  "maxResultsPerSearch": 30,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

All scraped records (videos, comments, creator profiles, creator videos, search results) in the default dataset.

# 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 = {
    "videoUrls": [
        "https://www.kuaishou.com/short-video/3xq6vcny33w5ffm"
    ],
    "userProfiles": [
        "https://www.kwai.com/@oscaicos"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("stackrelay/kuaishou-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 = {
    "videoUrls": ["https://www.kuaishou.com/short-video/3xq6vcny33w5ffm"],
    "userProfiles": ["https://www.kwai.com/@oscaicos"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("stackrelay/kuaishou-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 '{
  "videoUrls": [
    "https://www.kuaishou.com/short-video/3xq6vcny33w5ffm"
  ],
  "userProfiles": [
    "https://www.kwai.com/@oscaicos"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call stackrelay/kuaishou-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/6svuLALtUoKXosDMr/builds/zPiF6vJdlZseAd6RK/openapi.json
