# Douyin Pro Scraper (`habit.zhou/douyin-pro-scraper`) Actor

Five-mode Douyin (China TikTok) scraper: keyword search, video detail, user profile + uploads, hashtag feed, hot search board. Returns caption, author, plays, likes, comments, shares, collects, cover, video URL, publish time, music. No login. For China trend research, KOL discovery, AI training.

- **URL**: https://apify.com/habit.zhou/douyin-pro-scraper.md
- **Developed by:** [Seller Aim](https://apify.com/habit.zhou) (community)
- **Categories:** Social media, Videos, AI
- **Stats:** 58 total users, 9 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 search / list 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/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

## Douyin Pro Scraper

Full-featured **Douyin / 抖音** (China TikTok) scraper. Five modes, one Actor, clean structured JSON. No login, no cookies, no broken-token surprises.

Built for serious workloads — China short-video trend research, KOL / KOC discovery, AI training pipelines harvesting Chinese-language video metadata, brand-watch dashboards, hashtag campaign tracking.

### What does this Actor do?

Pick a mode, give it inputs, get a dataset:

- **Keyword search** — search Douyin by keyword. Three sort modes (comprehensive, most liked, newest) × four time windows (any / 24h / week / 6 months).
- **Video detail by aweme ID / URL** — paste a numeric aweme ID, a full `douyin.com/video/<id>` URL, or a short `v.douyin.com/...` share link; get caption, author, plays, likes, comments, shares, collects, cover, video URL, music, hashtags, and (optional) top comments.
- **User profile + uploads** — fetch a creator's profile (followers, gender, location, verification badge, total favorites) and their recent uploaded videos with pagination.
- **Hashtag feed** — pull every recent video tagged with a Douyin challenge ID, plus the hashtag's metadata (view count, user count).
- **Hot search board** — Douyin's live "hot search" board — what's trending across the entire app right now.

Each video returns a flat, schema-validated JSON row that's downloadable as JSON, CSV, Excel, HTML, or XML — and queryable via the Apify REST API for pipeline integration.

### Why use Douyin Pro Scraper?

- **No cookies, no breakage.** Other Douyin actors in the store rely on the user's logged-in Douyin cookie that expires every few days. Customers end up with a stream of -352 / 412 errors and 1.5★ reviews. We use a maintained backend surface that stays stable.
- **Five modes in one Actor.** Search, detail, user, hashtag, hot — pick a mode per run; no juggling separate Actors.
- **Full-field output.** Caption, author + sec\_uid, plays, likes, comments, shares, collects, forwards, cover URL, play URL, music title, hashtags, publish time — all in one row.
- **AI training-ready.** Chinese-language video metadata, clean JSON, deduplicable by `awemeId`. Drop straight into a vector DB, an LLM fine-tune set, or a trend classifier.
- **Marketing dashboards.** Schedule keyword + hashtag runs hourly and build a real-time pulse of any brand, product, or campaign on China's #1 short-video app.

### How to use

1. Open the Actor and click **Try for free**.
2. In the Input tab, pick a **Scrape mode** (search is the default).
3. Fill the inputs for your mode:
   - **search**: keywords, optional `sortType` + `publishTime`
   - **videos**: aweme IDs / douyin.com URLs / v.douyin.com short links in `videoIds`
   - **user**: `sec_uid` strings in `secUserIds` (find in `douyin.com/user/<sec_uid>`)
   - **hashtag**: numeric challenge IDs in `hashtagIds`
   - **hot**: nothing required
4. Set **Max items per input** (default 50).
5. Click **Save & Start**. Results stream into the dataset live.
6. Download or stream the dataset; schedule the run under the **Schedules** tab.

### Input

| Field | Type | Used in mode | Description |
|---|---|---|---|
| `mode` | string | all | One of `search`, `videos`, `user`, `hashtag`, `hot`. |
| `keywords` | array<string> | search | Search queries; Chinese or English. |
| `sortType` | enum | search | `_0` comprehensive / `_1` most liked / `_2` newest. |
| `publishTime` | enum | search | `_0` any / `_1` 24h / `_7` last week / `_180` last 6mo. |
| `videoIds` | array<string> | videos | Aweme IDs, douyin.com URLs, or v.douyin.com short links. |
| `secUserIds` | array<string> | user | Opaque `MS4wLjABAAAA…` sec\_uid strings or full user URLs. |
| `hashtagIds` | array<string> | hashtag | Numeric Douyin challenge IDs. |
| `maxItemsPerInput` | integer (1–1000) | all | Cap per input. Default 50. |
| `fetchComments` | boolean | videos | Fetch up to 20 top comments per video. Extra cost. |

JSON example — keyword search:

```json
{
    "mode": "search",
    "keywords": ["AI", "Claude"],
    "sortType": "_1",
    "publishTime": "_7",
    "maxItemsPerInput": 100
}
```

### Output

```json
{
    "awemeId": "7642544676239790570",
    "caption": "工作放手交给AI ...",
    "author": "写AI的老韩",
    "authorSecUid": "MS4wLjABAAAAZ-cmp_SmexldJ_NyG4",
    "authorUid": "12345678901234",
    "authorAvatar": "https://p3-pc.douyinpic.com/...avatar.jpg",
    "cover": "https://p3-pc.douyinpic.com/...cover.jpg",
    "videoUrl": "https://www.douyin.com/video/7642544676239790570",
    "playUrl": "https://aweme-cdn.douyinpic.com/...play.mp4",
    "duration": 119955,
    "plays": 482915,
    "likes": 39201,
    "comments": 1832,
    "shares": 2841,
    "collects": 12480,
    "forwards": 220,
    "publishedAt": "2026-05-18T08:15:00.000Z",
    "music": "原创音乐 - 写AI的老韩",
    "hashtags": ["#ai量化", "#搞钱", "#分享"],
    "keyword": "AI",
    "scrapedAt": "2026-05-22T14:34:25.000Z"
}
```

#### Output fields

| Field | Description |
|---|---|
| `awemeId` | Douyin's internal video ID (canonical). |
| `caption` | Video caption / description. |
| `author` | Creator display name. |
| `authorSecUid` | Opaque sec\_uid — pair with `mode: "user"` to drill in. |
| `authorUid` | Numeric uid. |
| `authorAvatar` | Creator avatar URL. |
| `cover` | Cover thumbnail URL. |
| `videoUrl` | Public Douyin page URL. |
| `playUrl` | Direct video play URL (may expire). |
| `duration` | Length in milliseconds. |
| `plays` | Play count. |
| `likes` | Digg / like count. |
| `comments` | Comment count. |
| `shares` | Share count. |
| `collects` | Save / favorite count. |
| `forwards` | Forward / repost count. |
| `publishedAt` | ISO 8601 publish time. |
| `music` | Music track title. |
| `hashtags` | Hashtags referenced in the caption. |
| `userProfile` | Creator profile object (user mode only). |
| `hashtag` | Hashtag metadata object (hashtag mode only). |
| `topComments` | Top 20 comments (videos mode with `fetchComments`). |
| `scrapedAt` | ISO 8601 timestamp of scrape. |

### Pricing

**$4.99 per 1,000 results.** Each video returned counts as one result. `videos` mode with `fetchComments=true` returns richer rows but is billed at the same rate.

#### Free vs. paid Apify plans

Apify free-plan users get **2 sample runs capped at 10 results each** so you can verify the data shape and quality before committing. Further runs from free accounts are blocked with an upgrade prompt — this Actor relies on a paid backend, so we can't subsidise unlimited free use. Any Apify paid plan ($49/month and up — see [Apify pricing](https://apify.com/pricing)) unlocks unlimited runs at the rate above.

#### Cost estimates

| Goal | Items / run | Mode | Est. cost / run |
|---|---|---|---|
| Quick scan of one keyword | 50 | search | ~$0.20 |
| Hashtag campaign round-up | 500 | hashtag | ~$2.00 |
| KOL deep dive | 200 uploads | user | ~$0.80 |
| Daily brand monitoring | 1,000 | search | ~$4.00 / day |

Apify also charges a small compute fee (typically $0.01-0.05 per minute of run time).

### Tips

- **Schedule, don't poll.** Douyin trends turn over fast; scheduling hourly during campaign launches captures the peak.
- **Deduplicate by `awemeId`.** Sequential runs overlap; merge and dedupe on `awemeId`.
- **Pair user + videos modes.** Use `mode: "user"` to find prolific creators, then drill into top videos with `mode: "videos"` + `fetchComments`.
- **`publishTime: "_1"` + `sortType: "_2"`** for real-time newest-first keyword monitoring (last 24h).
- **`hot` mode is cheap and high-signal.** Run it every 30 min to track real-time trending terms before your competitors notice.

### FAQ

**Q: Why is this Actor different from the other Douyin scrapers on the Store?**
A: Most existing actors depend on the customer providing a logged-in Douyin cookie that expires within days. We don't. We've engineered around stable backend surfaces so the Actor stays usable across cookie expiries.

**Q: Will this break when Douyin changes their API?**
A: Possibly. Our team maintains the backend; we patch usually within 24-72 hours of a backend change. Bug reports via the Issues tab.

**Q: Is scraping Douyin legal?**
A: We pull only publicly-accessible content — what any visitor can see without an account. Your usage is your responsibility; comply with your jurisdiction's law and Douyin's Terms of Service.

**Q: Can I get my data via API?**
A: Yes. Every Apify run exposes a stable [REST API](https://docs.apify.com/api/v2) for inputs, datasets, and run status. Plug into n8n, Make, Zapier, or your own pipeline.

**Q: How do I find a user's sec\_uid?**
A: Open the creator profile on `douyin.com` or in the Douyin app share menu; the URL contains `/user/<sec_uid>`. It looks like `MS4wLjABAAAA…`.

**Q: How fast are runs?**
A: Search: ~3 seconds per page (~10 videos). User: ~2 seconds per page (20 videos). Video detail: ~1 second per video. Hashtag: ~2 seconds per page.

**Q: I need a richer integration or higher-volume contract.**
A: Reach out via Apify chat. Custom endpoints and SLAs available on request.

# Actor input Schema

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

What to pull from Douyin.

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

Search queries. Chinese or English both work.

## `sortType` (type: `string`):

Sort criterion for search results.

## `publishTime` (type: `string`):

Filter by recency.

## `videoIds` (type: `array`):

Aweme IDs (numeric) or full https://www.douyin.com/video/<id> URLs. Short v.douyin.com links also accepted.

## `secUserIds` (type: `array`):

Opaque sec\_uid strings from Douyin profile URLs (https://www.douyin.com/user/\<sec\_uid>). Looks like 'MS4wLjABAAAA...'.

## `hashtagIds` (type: `array`):

Numeric Douyin challenge IDs (ch\_id). Pull from hashtag URLs: douyin.com/hashtag/<id>.

## `maxItemsPerInput` (type: `integer`):

Cap per keyword / user / hashtag. Each item is one billed result.

## `fetchComments` (type: `boolean`):

When on, fetches up to 20 top comments per video (videos mode only). Extra cost per video.

## Actor input object example

```json
{
  "mode": "search",
  "keywords": [
    "AI"
  ],
  "sortType": "_0",
  "publishTime": "_0",
  "videoIds": [],
  "secUserIds": [],
  "hashtagIds": [],
  "maxItemsPerInput": 50,
  "fetchComments": false
}
```

# Actor output Schema

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

No description

# 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 = {
    "keywords": [
        "AI"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("habit.zhou/douyin-pro-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 = { "keywords": ["AI"] }

# Run the Actor and wait for it to finish
run = client.actor("habit.zhou/douyin-pro-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 '{
  "keywords": [
    "AI"
  ]
}' |
apify call habit.zhou/douyin-pro-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/nnHXcWHsRr4CSRuu2/builds/ldHaE0PUD2VqRvlz9/openapi.json
