# Douyin Video Search Scraper (`toolzerhub/douyin-video-search-scraper`) Actor

Search public Douyin videos by keyword, with filters for sort order, recency, length, and content type. Every row returns the caption, publish date, duration, play/like/comment/share counts, sound, and author. Export the Douyin data, run via API, or schedule recurring keyword monitoring.

- **URL**: https://apify.com/toolzerhub/douyin-video-search-scraper.md
- **Developed by:** [ToolzerHub](https://apify.com/toolzerhub) (community)
- **Categories:** Social media, Automation, For creators
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

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/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 Search Scraper

Search public Douyin videos by keyword and export every match as structured data — caption, publish date, duration, engagement stats, sound, and author — with filters for sort order, recency, length, and content type.

### Input

| Field | Use it for |
|---|---|
| **`keyword`** | Search term. Required. Chinese terms return the most results. |
| **`sort_type`** | `0` Most relevant (default), `1` Most liked, `2` Most recent. |
| **`publish_time`** | `0` Any time (default), `1` Past day, `7` Past week, `180` Past six months. |
| **`filter_duration`** | `0` Any length (default), `0-1` Under a minute, `1-5` One to five minutes, `5-10000` Over five minutes. |
| **`content_type`** | `0` Any (default), `1` Video, `2` Image and text, `3` Article. |
| **`addonVideoDetails`** | Fetch full video detail for every hit. One extra request per video, extra charge per row. Off by default. |
| **`maxItems`** | Caps the run. Default `100`. Set `0` for no limit. |

```json
{
  "keyword": "猫咪",
  "sort_type": "1",
  "publish_time": "7",
  "maxItems": 100
}
```

### Output

| Field | Contents |
|---|---|
| **`aweme_id`** | Unique video ID |
| **`desc`** | Caption text |
| **`create_time`** | Unix timestamp published |
| **`duration`** | Video length, milliseconds |
| **`statistics`** | `digg_count`, `comment_count`, `share_count`, `collect_count` |
| **`author`** | The account that posted it |
| **`music`** | The sound attached to the video |
| **`video`** | Cover images and play addresses |
| **`images`** | Image list, on image posts |
| **`share_url`** | Public share link |
| **`text_extra`**, **`cha_list`** | Hashtags and mentions parsed from the caption |
| **`source_keyword`** | The term this row was collected for |
| **`video_detail`** | Full video detail, only when `addonVideoDetails` is on |

```json
{
  "aweme_id": "7638421607305230298",
  "desc": "你说它是憨呢还是犟 就这么杵着冲 也不趴着睡#小奶包猫咪 #蓝金渐层 #萌宠养猫",
  "create_time": 1778458620,
  "statistics": { "digg_count": 1109292, "comment_count": 18420, "share_count": 572913, "collect_count": 62961 },
  "source_keyword": "猫咪"
}
```

### Questions

**Why did I get fewer rows than `maxItems`?**
Douyin's search answers with a mixed card list. Video hits sit alongside other card types — a related-search-word suggestion, for one — that carry no video and are filtered out before they reach the dataset. A page of raw cards routinely yields fewer video rows than it fetched.

**Do I need to handle pagination myself?**
No. Douyin's search requires a continuation token on every page past the first. The Actor reads it off the previous response and resends it automatically.

**What does `addonVideoDetails` actually add?**
One more request per video, billed per enriched row, adding a `video_detail` object alongside the row's own fields. Leave it off if the caption, stats, sound, and author already on each row are enough.

### Related Actors

| Actor | Purpose |
|---|---|
| [Douyin Search Scraper](https://apify.com/toolzerhub/douyin-search-scraper) | Search hashtags, sounds, image posts, experience posts, schools, or suggestions for the same keyword |
| [Douyin User Search Scraper](https://apify.com/toolzerhub/douyin-user-search-scraper) | Search for accounts instead of videos |
| [Douyin Video Scraper](https://apify.com/toolzerhub/douyin-video-scraper) | Already have video IDs? Get full detail, stats, or related videos without searching |
| [Douyin Profile Videos Scraper](https://apify.com/toolzerhub/douyin-profile-videos-scraper) | Pull every video from one known profile instead of a keyword |

### Support

Questions, bugs, or feature requests: **contact@toolzerhub.com**

Browse the rest: [apify.com/toolzerhub](https://apify.com/toolzerhub)

# Actor input Schema

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

Words or phrase to search for. Chinese terms return the most results.

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

Maximum rows to save. Set 0 to keep collecting until the source is exhausted.

## `sort_type` (type: `string`):

Order for the results.

## `publish_time` (type: `string`):

Only keep posts published in this window.

## `filter_duration` (type: `string`):

Only keep videos of this length.

## `content_type` (type: `string`):

Only keep this kind of post.

## `addonVideoDetails` (type: `boolean`):

Fetch full video detail for every video found. This makes one extra request per video and adds a charge per enriched row.

## Actor input object example

```json
{
  "keyword": "猫咪",
  "maxItems": 20,
  "sort_type": "0",
  "publish_time": "0",
  "filter_duration": "0",
  "content_type": "0",
  "addonVideoDetails": false
}
```

# Actor output Schema

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

Every record collected during this run

# 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 = {
    "keyword": "猫咪",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("toolzerhub/douyin-video-search-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 = {
    "keyword": "猫咪",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("toolzerhub/douyin-video-search-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 '{
  "keyword": "猫咪",
  "maxItems": 20
}' |
apify call toolzerhub/douyin-video-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,toolzerhub/douyin-video-search-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/aS20N2PAD2naiyvfW/builds/90bqS9pfDxBzouYCR/openapi.json
