# 🎵 Douyin Content Scraper (`ethereal_wool/douyin-content-scraper`) Actor

Extract Douyin content data — likes, plays, author, and more. Scrape by keyword, URL or ID. Export to JSON, CSV & Excel, use the API, schedule runs and integrate. No code required.

- **URL**: https://apify.com/ethereal\_wool/douyin-content-scraper.md
- **Developed by:** [Jackie Chen](https://apify.com/ethereal_wool) (community)
- **Categories:** Social media, Videos
- **Stats:** 14 total users, 5 monthly users, 91.0% 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

## Douyin Video & Content Scraper

![douyin-content-scraper](https://api.apify.com/v2/key-value-stores/48FFrfZnw5XqzUC1C/records/douyin-content-scraper__hero)

Scrape **Douyin (抖音)** content four ways: **keyword video search**, **user profile videos**,
**video comments**, and the **hot-search trending list (热榜)**. Returns clean, structured data
for each record — description, play / like / comment / share / collect counts, cover and video
URLs, music title, author info, and the canonical video URL.

> **Unofficial.** This Actor is not affiliated with, authorized, or endorsed by Douyin or
> ByteDance (字节跳动). It is an independent tool that retrieves publicly available data via a
> third-party API. Use it in compliance with Douyin's terms and all applicable laws; you are
> responsible for how you use the retrieved data.

### What it does

- **Keyword search** — give one or more keywords; the Actor paginates Douyin video search
  results for each. Sort by comprehensive / most-liked / latest and filter by publish time.
- **User profile** — give one or more `sec_user_id` values (the long `MS4wLjAB...` id from a
  profile URL or share link) to scrape the videos a creator has posted.
- **Video comments** — give one or more video IDs (`aweme_id`) to scrape their comments; one
  dataset item is pushed per comment.
- **Hot-search trending list** — enable `includeHotSearch` to also pull the current Douyin
  热榜, one item per trending word.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `searchKeywords` | string\[] | `["美食"]` | Keywords to search. Each is paginated independently. Chinese keywords return the most results. |
| `userIds` | string\[] | `[]` | Douyin `sec_user_id` values whose posted videos to scrape. |
| `awemeIds` | string\[] | `[]` | Douyin video IDs (`aweme_id`) to scrape comments from. |
| `includeHotSearch` | boolean | `false` | Also scrape the hot-search trending list. |
| `maxItems` | integer | `50` | Max total items across all modes. |
| `sortType` | enum | `_0` | `_0` comprehensive / `_1` most liked / `_2` latest (search only). |
| `publishTime` | enum | `_0` | `_0` no limit / `_1` last day / `_7` last week / `_180` last 6 months (search only). |
| `maxCommentsPerVideo` | integer | `50` | Cap on comments fetched per video ID. |

#### Example input

```json
{
  "searchKeywords": ["美食", "穿搭"],
  "userIds": ["MS4wLjABAAAAgYvMaLdCBKJ_4vwmBkxDnv8ZbC8pL1gYRBA7sbgV_E0"],
  "awemeIds": ["7614772719099333894"],
  "includeHotSearch": true,
  "maxItems": 200,
  "sortType": "_1"
}
```

### Output

Video item (from search / user modes):

```json
{
  "id": "7614772719099333894",
  "type": "video",
  "url": "https://www.douyin.com/video/7614772719099333894",
  "shareUrl": "https://www.iesdouyin.com/share/video/...",
  "description": "茄子放入肉馅，这个是最近很火的茄子新吃法 #茄子新吃法",
  "createTime": 1772964000,
  "durationMs": 41402,
  "diggCount": 377385,
  "commentCount": 4280,
  "shareCount": 303968,
  "playCount": 0,
  "collectCount": 0,
  "coverUrl": "https://...",
  "playUrl": "https://...",
  "downloadUrl": "https://...",
  "musicTitle": "@小婷美食记创作的原声",
  "author": {
    "secUid": "MS4wLjABAAAA...",
    "uid": "391894996886567",
    "uniqueId": "...",
    "nickname": "小婷美食记",
    "followerCount": 12345,
    "verified": false
  },
  "source": "search:美食"
}
```

Comment item (from `awemeIds` mode) and hot-search item (from `includeHotSearch`) share the
same flat shape with a `type` of `comment` / `hotSearch` respectively.

### Notes

- Data is sourced live; Douyin occasionally rate-limits, so the Actor retries transient
  Cloudflare / upstream blocks with exponential backoff.
- IDs are de-duplicated within a run.
- A bare run (no input) defaults to searching `美食` so it always returns data.

***

### Why this Actor

- **Direct API, no headless browser** — fast, stable runs with nothing to babysit.
- **No login, no cookies** — we never touch your accounts, so there's no ban risk.
- **Fresh, real-time data** — every run reads the source live, not a stale cache.
- **Pay per result** — you're billed only for the rows actually delivered.
- **Structured JSON** — export to CSV, Excel, or JSON, or pull straight from the API / MCP.

### Use cases

- Pull structured content + engagement for analytics dashboards.
- Track a creator's or topic's output and performance over time.
- Build training/research datasets of posts and metadata.
- Power competitor and trend monitoring.

### FAQ

**Do I need an account, cookies, or to log in anywhere?**
No. The Actor talks to a fast, direct HTTP API server-side — you just provide inputs and run it.

**How am I billed?**
Pay-per-result: a fixed price per row returned, with no separate platform/compute charge. Caps like `maxItems` keep spend predictable.

**Can I run it on a schedule or call it from my app?**
Yes — use Apify Schedules, the REST API, the JavaScript / Python clients, or the MCP server. See the **API** tab.

**Is this affiliated with Douyin (抖音)?**
No. It's an independent tool that collects publicly available data. Use it in line with the platform's terms and applicable law.

**How do I get a `sec_user_id` or `aweme_id`?** A `sec_user_id` is the long `MS4wLjAB...` string in a profile share link; an `aweme_id` is the number in `douyin.com/video/<id>`.

### More Douyin (抖音) scrapers by us

- [**Douyin Xingtu KOL**](https://apify.com/ethereal_wool/douyin-xingtu-kol-scraper) — Influencer search · fans portrait · Xingtu index

Browse the full fleet → **https://apify.com/ethereal\_wool**

# Actor input Schema

## `searchKeywords` (type: `array`):

Keywords to search Douyin videos for. Each keyword is searched and paginated independently. Chinese keywords return the most results.

## `userIds` (type: `array`):

Douyin sec\_user\_id values (the long 'MS4wLjAB...' id from a profile URL or share link) whose posted videos you want to scrape.

## `awemeIds` (type: `array`):

Douyin video IDs (aweme\_id, the numeric id in a video URL). The Actor scrapes the comments of each of these videos and pushes one item per comment.

## `includeHotSearch` (type: `boolean`):

Also scrape the current Douyin hot-search (热榜) trending list and push one item per trending word.

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

Maximum total number of items to scrape across all keywords, users, comment sets, and the trending list.

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

How to sort keyword-search results.

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

Restrict keyword-search results to videos published within a recent window.

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

Maximum top-level comments to fetch per video ID in the Video IDs (comments) mode.

## `downloadVideos` (type: `boolean`):

Download each video's watermark-free MP4 into the key-value store and add a `downloads.videoFile` link to the item. Billed as a separate pay-per-event add-on.

## `downloadCovers` (type: `boolean`):

Download each video's cover/thumbnail image into the key-value store (`downloads.coverFile`).

## `downloadSlideshow` (type: `boolean`):

For image-text (图文) posts, download every slide into the key-value store (`downloads.slideFiles`).

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

Optional. Route the upstream API calls through an Apify Proxy to vary the source IP. Usually not needed.

## Actor input object example

```json
{
  "searchKeywords": [
    "美食"
  ],
  "userIds": [],
  "awemeIds": [],
  "includeHotSearch": false,
  "maxItems": 50,
  "sortType": "_0",
  "publishTime": "_0",
  "maxCommentsPerVideo": 50,
  "downloadVideos": false,
  "downloadCovers": false,
  "downloadSlideshow": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "searchKeywords": [
        "美食"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ethereal_wool/douyin-content-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 = { "searchKeywords": ["美食"] }

# Run the Actor and wait for it to finish
run = client.actor("ethereal_wool/douyin-content-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 '{
  "searchKeywords": [
    "美食"
  ]
}' |
apify call ethereal_wool/douyin-content-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/5HH2mK1MwtxicHv5N/builds/OQqJoG60fcheqSyrf/openapi.json
