# Douyin Scraper — TikTok China API & Video Downloader (`sian.agency/douyin-scraper`) Actor

Douyin scraper for TikTok China — extract video data, user profiles, comments, reply threads, and keyword search. KOL discovery, view counts, engagement metrics, China market research. Seven operations, one clean dataset per run. No API key.

- **URL**: https://apify.com/sian.agency/douyin-scraper.md
- **Developed by:** [SIÁN OÜ](https://apify.com/sian.agency) (community)
- **Categories:** Social media, Videos, Automation
- **Stats:** 468 total users, 59 monthly users, 100.0% runs succeeded, 7 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.00 / 1,000 user 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/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

## Douyin Scraper — TikTok China Videos, KOL Data, Comments & Search 🎥

[![SIÁN Agency Store](https://img.shields.io/badge/Store-SI%C3%81N%20Agency-1AE392)](https://apify.com/sian.agency?fpr=sian) [![Taobao & Tmall](https://img.shields.io/badge/Store-Taobao%20%26%20Tmall-FF4F00)](https://apify.com/sian.agency/taobao-tmall-product-scraper?fpr=sian) [![Kwai & Kuaishou](https://img.shields.io/badge/Store-Kwai%20%26%20Kuaishou-FF4906)](https://apify.com/sian.agency/kwai-kuaishou-scraper?fpr=sian) [![TikTok Transcripts](https://img.shields.io/badge/Store-TikTok%20Transcripts-25F4EE)](https://apify.com/sian.agency/best-tiktok-ai-transcript-extractor?fpr=sian)

#### 🎉 Seven scrapers in one — extract video data, profiles, comments, reply threads, user posts & keyword search from Douyin (TikTok China)

##### Built for KOL agencies, China-market researchers, brand teams, and content strategists who need clean structured Douyin data — no API key, no setup, no scraping headaches

***

### 🔎 What is the Douyin Scraper — and when should you use it?

The **Douyin Scraper** turns a Douyin video id, creator secUid or search keyword into clean, structured rows. Filter them, export them, or feed them straight into a spreadsheet, database or AI agent. No account, no portal API key, and no browser automation to keep alive.

**Use it when you need:** play, like, share and comment counts on Douyin videos, plus captions and playable video URLs. Creator profiles with follower and total-like counts, and a creator's whole posting history. Comments, the reply threads underneath them, and keyword search across both videos and creators.

**Use something else when:** you want what a creator sells rather than what they post. [Douyin Shop Scraper](https://apify.com/sian.agency/douyin-shop-scraper?fpr=sian) covers products, prices and shop data. And when the question is what a creator costs to book, [Douyin Xingtu KOL Analytics](https://apify.com/sian.agency/douyin-xingtu-kol-analytics?fpr=sian) reads the creator marketplace instead.

***

### 🤖 Use with AI agents

Already connected to the [Apify MCP server](https://mcp.apify.com)? Just ask for this Actor by name: sian.agency/douyin-scraper

**Your agent can pay for its own runs.** This Actor is eligible for [agentic payments](https://docs.apify.com/platform/actors/publishing/monetize), so an agent can discover it, run it and settle the bill over [x402](https://www.x402.org/) (USDC on Base) or [Skyfire](https://www.skyfire.xyz/) — without an Apify account or API token of its own. Billing is the same either way: per successful row, never for errors.

Otherwise copy this prompt into Claude, ChatGPT, Cursor or any MCP-enabled assistant:

```text
I want to research a niche on Douyin (TikTok China) using the Apify Actor `sian.agency/douyin-scraper`.

Use it when I need: Douyin video metrics (plays, likes, shares, comments), creator
profiles and follower counts, a creator's full video catalog, comment threads and their
nested replies, or keyword search across videos and creators.

Don't use it when: I want products and prices from a creator's shop — use
`douyin-shop-scraper` instead. For what a creator charges for a brand deal, use
`douyin-xingtu-kol-analytics`.

How to call it: pick ONE `operation` per run.
- `searchVideo` / `searchUser` take a `keyword` (Chinese, English or mixed queries all work)
- `videoDetail` takes a `videoId`
- `videoComments` takes a `videoId`
- `videoSubComments` takes a `videoId` plus a `commentId`
- `userDetail` and `userVideos` take a `secUid`
- `userVideos` also accepts `sortType`: "LATEST" or "MOST_POPULAR"
- Paginated operations accept `maxPages` (1-50)

Start with this input:
{
  "operation": "searchVideo",
  "keyword": "美食",
  "maxPages": 3
}

Ask me which keyword to search and how many pages to pull, then run the Actor and
summarise the results as a table.
```

**Things you can ask your agent for:**

- *"Find the most-played Douyin videos for 美食 right now and list the creators behind them."*
- *"Pull every comment on this Douyin video, then the reply threads under the three most-liked ones, and tell me what people are complaining about."*
- *"Shortlist Douyin creators matching skincare, then pull each one's top posts sorted by popularity so I can see what actually works."*

Machine-readable API, MCP config and OpenAPI definition for this Actor are published at [apify.com/sian.agency/douyin-scraper.md](https://apify.com/sian.agency/douyin-scraper.md).

***

### 📋 Overview

**Tired of brittle DIY scrapers that break every time Douyin ships a UI tweak?** This actor delivers reliable, flat structured datasets from China's #1 short-video platform (700M+ DAU) — one clean run per task, one tidy dataset out.

**Why teams choose SIÁN for Douyin data:**

- ✅ **Seven operations, one actor**: video detail · user profile · user video catalog · comments · **sub-comments (reply threads)** · search videos · search users
- 🧵 **Reply-thread depth no competitor offers** — pull the full conversation tree under any comment, not just top-level
- 🔍 **Full-text search built in** — both `searchVideo` and `searchUser` work with Chinese, English, and mixed queries
- ⚡ **10–20 results per page** on search & user feeds — paginate to 50 pages in a single run
- 🎯 **Production-ready data shape**: curated camelCase aliases (videoId, secUid, userName, playCount, likeCount, caption, postedAt, …) PLUS the raw Douyin fields for power users
- 💰 **Pay-per-result pricing** — only charged for successful extractions, never for empty pages or errors
- 💎 **No API key, no setup, no proxies** — paste a video ID, sec UID, or keyword and run
- ✨ **19-digit Douyin aweme/uid/cid preserved at full precision** (most scrapers silently corrupt them); HTTPS auto-normalized on every media URL

***

### ✨ Features

- 🎥 **Video Detail**: caption, play/like/share/comment/collect counts, playable video URL, cover, music, creator info, duration, timestamps
- 👤 **User Profile**: follower count, following count, total likes received, post count, bio, verification badge, IP location, full avatar set
- 📹 **User Videos**: full creator video catalog with engagement metrics, paginated ~20 videos/page — sort by **latest** or **all-time most popular**
- 💬 **Video Comments**: top-level comments with author, IP location, like count, reply count, hot-comment flag
- 🧵 **Video Sub-Comments**: paginated reply threads under any comment — **unique to this actor** (no Douyin competitor exposes nested replies)
- 🔍 **Search Videos**: keyword search supporting Chinese, English, and mixed queries — ~12 results/page
- 🔎 **Search Users**: discover creators by keyword with handle, followers, verification, bio — ~19 results/page
- 🖼️ **HTTPS-normalized URLs**: every video URL, cover, avatar, and music track ready to embed
- 🆔 **BigInt-safe IDs**: 19-digit Douyin aweme/uid/cid preserved (no precision loss → no broken cross-operation joins)
- 📄 **Cursor pagination**: stream through up to 50 pages per run with one input parameter
- 📊 **HTML run report**: saved automatically to key-value store with success rate, errors, duration, inputs

***

### 🎬 Quick Start

Paste a keyword to search Douyin trending videos — no Douyin API or downloader software required.

```bash
curl -X POST https://api.apify.com/v2/acts/sian.agency~douyin-scraper/runs?token=YOUR_TOKEN \
-d '{"operation":"searchVideo","keyword":"美食","maxPages":3}'
```

***

### 🚀 Getting Started (3 Simple Steps)

#### Step 1: Pick an operation

Choose what you want to extract: Search Videos, Search Users, Video Detail, User Profile, User Videos, Video Comments, or Video Sub-Comments.

#### Step 2: Enter the input

A keyword (search), a video ID (detail/comments/sub-comments), a sec UID (profile/videos), or a comment ID (sub-comments).

#### Step 3: Click "Start"

Results stream into the Apify dataset as they come back. Download as JSON, CSV, or Excel directly from the Console.

**That's it! In under 60 seconds, you'll have:**

- A flat, structured dataset (no nested CDN JSON to parse)
- Curated camelCase fields plus the raw response for power users
- An HTML report summarizing the run
- Ready-to-embed HTTPS media URLs (videos, covers, avatars, music)

***

### 📥 Input Configuration

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `operation` | string (enum) | Yes | One of: `videoDetail` · `userDetail` · `userVideos` · `videoComments` · `videoSubComments` · `searchVideo` · `searchUser` |
| `videoId` | string | If operation is `videoDetail`, `videoComments`, or `videoSubComments` | Douyin numeric video ID (also called `aweme_id`). Find it in any Douyin video URL after `/video/`. |
| `commentId` | string | If operation is `videoSubComments` | Numeric comment ID (`cid`). Find it in the `commentId` field of any `Video Comments` result row. |
| `secUid` | string | If operation is `userDetail` or `userVideos` | Encrypted user handle starting with `MS4wLjAB...`. Find it in any profile URL after `/user/` or in any result row's `secUid` field. |
| `keyword` | string | If operation is `searchVideo` or `searchUser` | Search query (Chinese, English, or mixed — e.g. `美食`, `dance`, `fashion`) |
| `sortType` | string (enum) | No | `userVideos` only — `LATEST` (default, newest → oldest) or `MOST_POPULAR` (all-time top videos ranked by engagement) |
| `maxPages` | integer | No | Pages to fetch for paginated operations (default 5, max 50) |

**Example — Search trending Douyin videos:**

```json
{
  "operation": "searchVideo",
  "keyword": "美食",
  "maxPages": 3
}
```

**Example — Pull a creator's full video catalog:**

```json
{
  "operation": "userVideos",
  "secUid": "MS4wLjABAAAAUT_tvNpyI5-tObkvU2xaaqyeDpek5UJXLG8mePjYxTQ",
  "maxPages": 10
}
```

**Example — Pull a creator's all-time most popular videos ("greatest hits" audit):**

```json
{
  "operation": "userVideos",
  "secUid": "MS4wLjABAAAAUT_tvNpyI5-tObkvU2xaaqyeDpek5UJXLG8mePjYxTQ",
  "sortType": "MOST_POPULAR",
  "maxPages": 2
}
```

**Example — Get full video details by ID:**

```json
{
  "operation": "videoDetail",
  "videoId": "7615930241370348219"
}
```

**Example — Pull reply thread for a specific comment:**

```json
{
  "operation": "videoSubComments",
  "videoId": "7615930241370348219",
  "commentId": "7615932448664650533",
  "maxPages": 5
}
```

***

### 📤 Output

Results are saved to the Apify dataset with **40+ curated fields** plus every raw Douyin field. Filter by `_operation` to split modes; two predefined dataset views ready to open in Apify Console (Overview / Comments).

| Field | Type | Description |
|-------|------|-------------|
| `videoId` / `awemeId` | string | Douyin video ID (19-digit, precision preserved) |
| `videoPageUrl` | string | Direct link to the video on Douyin |
| `caption` | string | Video caption (Chinese / English / mixed, with hashtags & mentions) |
| `videoUrl` | string | Playable video stream URL |
| `videoUrlList` | array | All quality variants of the stream |
| `coverUrl` | string | Primary video thumbnail |
| `dynamicCoverUrls` | array | Animated cover (loop preview) |
| `durationMs` | integer | Video length in milliseconds |
| `playCount` | integer | Total plays |
| `likeCount` | integer | Likes (digg_count) |
| `shareCount` | integer | Shares |
| `commentCount` | integer | Comments |
| `collectCount` | integer | Saves/bookmarks |
| `postedAt` | string | ISO-8601 timestamp |
| `musicId` / `musicTitle` / `musicAuthor` / `musicPlayUrl` | mixed | Background music metadata |
| `userId` | string | Creator's numeric UID |
| `secUid` | string | Creator's encrypted handle (use this for User Profile / User Videos) |
| `uniqueId` | string | Creator's public @handle |
| `userName` | string | Creator's display nickname |
| `userVerified` | boolean | Verification badge |
| `verifyReason` | string | Custom verification reason (e.g. enterprise/celebrity status) |
| `userPageUrl` | string | Direct link to the creator's profile |
| `avatarUrl` | string | Profile picture (HTTPS) |
| `followerCount` / `followingCount` / `totalFavorited` / `awemeCount` | integer | Profile stats |
| `userBio` | string | Profile signature/bio |
| `ipLocation` / `userCity` / `userProvince` / `userCountry` | string | Geo metadata |
| `commentId` | string | Comment ID (use as input to `Video Sub-Comments`) |
| `parentCommentId` | string | For sub-comments: the parent comment |
| `content` | string | Comment text |
| `replyCount` | integer | Number of replies under this comment |
| `isHot` | boolean | Pinned/stickied comment |
| `isAuthorDigged` | boolean | Liked by the video creator |

**Example dataset row (search video):**

```json
{
  "_operation": "searchVideo",
  "_sourceKeyword": "美食",
  "videoId": "7615930241370348219",
  "userId": "58743577344",
  "secUid": "MS4wLjABAAAAUT_tvNpyI5-tObkvU2xaaqyeDpek5UJXLG8mePjYxTQ",
  "userName": "章章干嘛呢",
  "uniqueId": "...",
  "caption": "夜宵简单吃个长沙滋啦冒油的炭烤牛肋排和三文鱼牛肉卷… #饭搭子 #深夜放毒 #寻味烟火气",
  "playCount": 0,
  "likeCount": 126484,
  "shareCount": 521446,
  "commentCount": 9883,
  "collectCount": 12144,
  "videoUrl": "https://...",
  "coverUrl": "https://...",
  "videoPageUrl": "https://www.douyin.com/video/7615930241370348219",
  "userPageUrl": "https://www.douyin.com/user/MS4wLjABAAAAUT_tvNpyI5-tObkvU2xaaqyeDpek5UJXLG8mePjYxTQ",
  "postedAt": "2026-04-..",
  "status": "success"
}
```

***

### 💼 Use Cases & Examples

#### 1. KOL & Creator Discovery for China-Market Brands

**Influencer marketing teams** at Western brands shortlisting Douyin KOLs for product seeding and brand partnerships.

**Input:** Search Users with keyword "美食" (food) or "时尚" (fashion)
**Output:** ~19 creators per page with follower counts, verification, bio, avatar, secUid
**Use:** Build a ranked KOL shortlist in 5 minutes instead of 5 hours of manual scrolling.

#### 2. China Market-Entry Research

**Market intelligence analysts** monitoring short-video trends before launching a brand in China.

**Input:** Search Videos with industry keyword across 10 pages
**Output:** 120+ videos with engagement metrics, captions, hashtags, posting times, music
**Use:** Spot trending themes, viral content patterns, and competitor activity weeks before launch.

#### 3. Content Trend Tracking

**Content strategists** at agencies tracking viral videos, breakout creators, and emerging hashtags daily.

**Input:** Scheduled Search Videos run with niche keyword
**Output:** Time-series of trending content + engagement velocity
**Use:** Feed a trend dashboard or alert system; spot virality 24–48 hours before mainstream.

#### 4. Deep Comment Sentiment Mining (Top-Level + Reply Threads)

**NLP / brand-perception teams** analyzing reactions on competitor videos or branded-content collaborations.

**Input:** Video Comments → high-engagement comment IDs → Video Sub-Comments on each
**Output:** All top comments + full reply trees with author, location, like counts
**Use:** Top-level comments are noisy. The argument happens in the replies underneath. Feed both to a sentiment model.

#### 5. Creator Catalog Mapping (KOL Audit)

**Influencer-marketing agencies** doing due diligence on a creator before signing them.

**Input:** User Videos across 10–20 pages for the creator's secUid. For a quick "greatest hits" audit, set `sortType: "MOST_POPULAR"` and pull 1–2 pages.
**Output:** Full posting history (or all-time top videos) with play/like/share counts and timestamps
**Use:** Check posting cadence and engagement drift. Fake-fan patterns show up fast once you can see every post at once.

#### 6. Brand Monitoring on Douyin

**Brand managers** tracking unauthorized mentions, branded-content performance, and counterfeits.

**Input:** Search Videos with brand or product keyword scheduled hourly
**Output:** Every new mention with creator + engagement
**Use:** React to viral mentions in near real-time; flag counterfeits & PR risks.

#### 7. Douyin Video Data for Content Re-purposing & Research

**Editors, researchers, & creators** working with public Douyin videos for commentary, education, or research.

**Input:** Video Detail by ID
**Output:** HTTPS-ready `videoUrl` + cover + music + full engagement stats
**Use:** Archive, repurpose, or analyze video content programmatically.

***

### 🔗 Integration Examples

#### JavaScript/Node.js

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_TOKEN' });

const run = await client.actor('sian.agency/douyin-scraper').call({
  operation: 'searchVideo',
  keyword: '美食',
  maxPages: 3,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0]);
```

#### Python

```python
from apify_client import ApifyClient
client = ApifyClient('YOUR_TOKEN')

run = client.actor('sian.agency/douyin-scraper').call(
    run_input={'operation': 'userVideos', 'secUid': 'MS4wLjAB...', 'maxPages': 5}
)

for item in client.dataset(run['defaultDatasetId']).iterate_items():
    print(item)
```

#### cURL

```bash
curl -X POST 'https://api.apify.com/v2/acts/sian.agency~douyin-scraper/runs?token=YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"operation":"videoDetail","videoId":"7615930241370348219"}'
```

#### Automation Workflows (N8N / Zapier / Make)

1. **Trigger**: schedule daily or webhook from a brief-creator
2. **HTTP Request**: call the actor's run-sync endpoint with `operation` + input
3. **Process**: filter by `_operation` and pivot on `videoId` / `secUid` / `commentId`
4. **Action**: push to BigQuery, Notion, Airtable, or a Slack alert

***

### 📊 Performance & Pricing

#### FREE Tier (Try It Now)

- **Full feature access** — every operation, every field, no quality compromise
- No credit card required
- Perfect for evaluating data depth before you commit

#### PAID Tier (Production Ready)

- **Unlimited** results per run
- Faster processing — no FREE-tier throttling
- Pay-per-result: only charged for successful rows, never for errors or empty pages
- Volume discounts up to 50% off at GOLD/PLATINUM/DIAMOND Apify tiers

💰 **Best price on the market for premium Douyin data** — see pricing tab for the full per-event ladder. Single-row operations (Video Detail, User Profile) carry richer payloads at premium pricing; bulk operations (Search, User Videos, Comments, Sub-Comments) are priced to scale with you.

🔗 [View current pricing](https://apify.com/sian.agency/douyin-scraper?fpr=sian)

***

### ❓ Frequently Asked Questions

**Q: How many videos / users / comments can I extract per run?**
A: FREE tier: full feature access for evaluation. PAID tier: unlimited — capped only by `maxPages` (default 5, max 50) and platform-side data availability.

**Q: Does it work with private profiles or shadow-banned accounts?**
A: No — only publicly accessible Douyin content is supported. Private accounts and banned users return empty or error rows.

**Q: What output formats are available?**
A: JSON, CSV, Excel, RSS, HTML, XML — export directly from the Apify dataset UI or via API.

**Q: Are video URLs permanent?**
A: Douyin CDN URLs typically expire after a few hours. Use `videoUrlList` for fallback mirrors, or re-run Video Detail when you need a fresh URL.

**Q: Why are Douyin video IDs 19 digits — does the dataset preserve them?**
A: Yes. We use a bigint-safe JSON parser so 19-digit IDs (`aweme_id`, `uid`, `cid`) round-trip without precision loss. Most scrapers silently corrupt these and break cross-operation joins.

**Q: How do I find a `secUid`?**
A: Visit any Douyin profile and copy the trailing segment of the URL (`https://www.douyin.com/user/{SEC_UID}`). The sec UID starts with `MS4wLjAB...` and is found in any video/comment result row's `secUid` field.

**Q: Can I search in Chinese?**
A: Absolutely — Chinese queries surface the most relevant native Douyin creators. English and mixed queries also work.

**Q: What's the difference between Video Comments and Video Sub-Comments?**
A: `Video Comments` returns top-level comments on a video. `Video Sub-Comments` returns the reply thread underneath a specific top-level comment. Use the workflow: run `Video Comments` first → grab comment IDs with `replyCount > 0` → run `Video Sub-Comments` for each.

**Q: Is this legal?**
A: Yes — we only extract publicly available data. See the [Legal section](#-is-it-legal-to-scrape-data) below.

**Q: How long does processing take?**
A: ~3–10 seconds per page for paginated operations; ~2–5 seconds for single-row operations.

***

### 🐛 Troubleshooting

**Page returned no rows / empty dataset**

- Verify the input is correct: video ID is 19 digits, secUid starts with `MS4wLjAB`, keyword is non-empty
- Check that the video/user still exists on Douyin (try opening `videoPageUrl` or `userPageUrl` from a result row)
- For sub-comments: the comment must have `replyCount > 0` to return reply data

**HTTP errors / "Data source temporarily unavailable" rows**

- The actor auto-retries transient failures up to 4 times with backoff. If error rows survive that, Douyin is rate-limiting or briefly unavailable — wait a few minutes and run it again.

**19-digit video IDs look truncated in spreadsheet exports**

- Spreadsheet apps (Excel, Google Sheets) auto-cast long integers to scientific notation. The actor preserves them as strings in JSON; in CSV exports, format the `videoId` column as Text before opening.

**Pagination ends earlier than `maxPages` requested**

- That means the platform served the last page. Check `_page` on the last row — `isLastPage` was true. Not all creators or keywords have 50 pages of content.

***

### ⚠️ Trademark Disclaimer

This actor is an **independent scraping tool** and is not affiliated with, endorsed by, or sponsored by Beijing Microlive Vision Technology Co., Ltd., Douyin, ByteDance Ltd., or any of its subsidiaries. "Douyin" and "TikTok China" are used solely in a descriptive sense to identify the public data source the actor reads from. **Douyin®** and **TikTok®** are trademarks of their respective owners. All other trademarks are the property of their respective owners.

***

### ⚖️ Is it legal to scrape data?

Our actors are ethical and do not extract any private user data, such as email addresses or private contact information. They only extract what the user has chosen to share publicly. We therefore believe that our actors, when used for ethical purposes by Apify users, are safe.

However, you should be aware that your results could contain personal data. Personal data is protected by the **GDPR** in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

You can also read Apify's blog post on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

***

### ✨ More by SIÁN Agency

Part of the SIÁN Agency Apify portfolio — production-grade scrapers and AI tools used by agencies, research teams, and brands. A few that pair well with Douyin:

**China & E-commerce**

- [Kwai & Kuaishou Scraper](https://apify.com/sian.agency/kwai-kuaishou-scraper?fpr=sian) — China's #2 short-video platform: videos, profiles, comments, search
- [Taobao & Tmall Product Scraper](https://apify.com/sian.agency/taobao-tmall-product-scraper?fpr=sian) — China's #1 marketplace: products, search, shop catalogs, reviews
- [Uber Eats Menu Scraper](https://apify.com/sian.agency/uber-eats-menu-scraper?fpr=sian) — restaurant menus + prices

**Short-Video & Social Media**

- [Best TikTok AI Transcript Extractor](https://apify.com/sian.agency/best-tiktok-ai-transcript-extractor?fpr=sian) — international TikTok video → text with metadata
- [Instagram AI Transcript Extractor](https://apify.com/sian.agency/instagram-ai-transcript-extractor?fpr=sian) — Reels & Stories transcription
- [Facebook AI Transcript Extractor](https://apify.com/sian.agency/facebook-ai-transcript-extractor?fpr=sian) — Facebook video → text
- [YouTube Shorts AI Transcript & Metadata Extractor](https://apify.com/sian.agency/youtube-shorts-ai-transcript-and-metadata-extractor?fpr=sian) — Shorts data + transcripts

**Real Estate (Global)**

- [Bayut (Dubai)](https://apify.com/sian.agency/bayut-property-scraper?fpr=sian) · [Idealista (Spain)](https://apify.com/sian.agency/smart-idealista-scraper?fpr=sian)

[Browse all SIÁN actors →](https://apify.com/sian.agency?fpr=sian)

***

### ⭐ Leave a 5-Star Review

Love this actor? **[Leave a 5-star review here](https://apify.com/sian.agency/douyin-scraper/reviews)** — it helps us build more features for you and lets other teams find it.

***

### 🤝 Support

**Join our active support community**

- For issues or questions, [open an issue](https://apify.com/sian.agency/douyin-scraper/issues) on the actor page
- 📧 <apify@sian-agency.online>

***

**Built by [SIÁN Agency](https://www.sian-agency.online)** | **[More Tools](https://apify.com/sian.agency?fpr=sian)**

# Changelog

This Actor's version history is a separate document: https://apify.com/sian.agency/douyin-scraper/changelog.md

# Actor input Schema

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

🎯 **PICK ONE OPERATION PER RUN.** Each run produces one clean dataset matching the chosen mode.

- **🎥 Video Detail** — deep scrape of a single Douyin video by ID (caption, play/like/share/comment counts, video URLs, cover, music, creator info)
- **👤 User Profile** — full profile by Sec UID (followers, total likes, post count, bio, verification, location, avatars)
- **📹 User Videos** — paginated list of a creator's full video history (~20 videos/page)
- **💬 Video Comments** — paginated top-level comments on a single video (~20 comments/page)
- **🧵 Video Sub-Comments** — paginated reply threads under a specific comment (~10 replies/page)
- **🔍 Search Videos** — keyword search across Douyin videos, paginated (~12 results/page)
- **🔎 Search Users** — keyword search across Douyin creators, paginated (~19 results/page)

💡 **TIP:** To combine operations (e.g. search → drill into top creators), run the actor multiple times with different configurations.

## `videoId` (type: `string`):

🎥 **Required for `Video Detail`, `Video Comments`, and `Video Sub-Comments` operations.**

The numeric Douyin video ID (also called `aweme_id`). You can find it:

- In any Douyin video URL: `https://www.douyin.com/video/{ID}` → the trailing segment
- In the `videoId` / `aweme_id` field of any search or user-videos result row

💡 **TIP:** To analyze a batch of videos, run a `Search Videos` operation first, copy the `videoId` values, then run `Video Detail` or `Video Comments` per ID.

⚠️ **Ignored** for User Profile, User Videos, and Search operations.

## `commentId` (type: `string`):

💬 **Required for `Video Sub-Comments` operation only.**

The numeric comment ID (also called `cid`) whose reply thread you want to extract. You can find it:

- In the `commentId` / `cid` field of any `Video Comments` result row
- Only comments with `replyCount > 0` will return reply data

💡 **TIP:** Run `Video Comments` first to identify high-engagement comments, then run `Video Sub-Comments` with those comment IDs to pull the full conversation tree.

⚠️ **Ignored** for all other operations.

## `secUid` (type: `string`):

👤 **Required for `User Profile` and `User Videos` operations.**

The Douyin `sec_uid` — an encrypted user handle starting with `MS4wLjAB...`. You can find it:

- In the `secUid` / `sec_uid` field of any video, search, or comment result row
- In a creator's profile URL: `https://www.douyin.com/user/{SEC_UID}`

💡 **TIP:** To build a list of creators in a niche, run `Search Users` with a keyword first, then use the top `secUid` values to drill into individual profiles or video catalogs.

⚠️ **Ignored** for Video Detail, Comments, and Search operations.

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

↕️ **Applies to the `User Videos` operation only.**

- **🕒 Latest first** — the creator's most recent posts, newest → oldest (default)
- **🔥 Most popular first** — the creator's all-time top videos, ranked by engagement

💡 **TIP:** `Most popular first` with 1–2 pages gives you an instant "greatest hits" audit of any creator — perfect for KOL vetting and content-strategy reverse engineering.

⚠️ **Ignored** for all other operations.

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

🔍 **Required for `Search Videos` and `Search Users` operations.**

Any Douyin search query. Supports Chinese, English, and mixed queries:

- `美食` (food)
- `搞笑视频` (funny videos)
- `dance`
- `fashion`

💡 **TIP:** Chinese-language queries surface the most relevant native Douyin creators. Specific niches return higher-quality results than broad terms.

## `maxPages` (type: `integer`):

📄 **Applies to paginated operations** (User Videos, Video Comments, Video Sub-Comments, Search Videos, Search Users). Ignored for single-record operations (Video Detail, User Profile).

- **User Videos:** ~20 videos per page
- **Video Comments:** ~20 comments per page
- **Video Sub-Comments:** ~10 replies per page
- **Search Videos:** ~12 results per page
- **Search Users:** ~19 results per page

💡 **TIP:** Start small (1–3 pages) to preview results before scaling up.

⚠️ Hard cap: 50 pages to prevent runaway runs.

## Actor input object example

```json
{
  "operation": "searchVideo",
  "videoId": "7615930241370348219",
  "commentId": "7615932448664650533",
  "secUid": "MS4wLjABAAAAUT_tvNpyI5-tObkvU2xaaqyeDpek5UJXLG8mePjYxTQ",
  "sortType": "LATEST",
  "keyword": "美食",
  "maxPages": 5
}
```

# Actor output Schema

## `output` (type: `string`):

Videos, profiles, comments, sub-comments, or search results — one flat row per upstream item with curated camelCase aliases (videoId, secUid, userName, playCount, likeCount, caption, postedAt, videoUrl, coverUrl, avatarUrl, …) plus the raw upstream fields spread alongside.

## `report` (type: `string`):

HTML run report — what this run delivered, a copy-paste shortlist of the top results, the itemized charges for the run, and one-click retry for anything that came back empty. Written even on fatal crash.

# 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 = {
    "videoId": "7615930241370348219",
    "commentId": "7615932448664650533",
    "secUid": "MS4wLjABAAAAUT_tvNpyI5-tObkvU2xaaqyeDpek5UJXLG8mePjYxTQ",
    "keyword": "美食"
};

// Run the Actor and wait for it to finish
const run = await client.actor("sian.agency/douyin-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 = {
    "videoId": "7615930241370348219",
    "commentId": "7615932448664650533",
    "secUid": "MS4wLjABAAAAUT_tvNpyI5-tObkvU2xaaqyeDpek5UJXLG8mePjYxTQ",
    "keyword": "美食",
}

# Run the Actor and wait for it to finish
run = client.actor("sian.agency/douyin-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 '{
  "videoId": "7615930241370348219",
  "commentId": "7615932448664650533",
  "secUid": "MS4wLjABAAAAUT_tvNpyI5-tObkvU2xaaqyeDpek5UJXLG8mePjYxTQ",
  "keyword": "美食"
}' |
apify call sian.agency/douyin-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sian.agency/douyin-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/46zHo0gkM5pua0Zuk/builds/27qaqkDB56K7p3WTE/openapi.json
