# Douyin Video Scraper: Links & Keywords (`luzivanlt/douyin-search-scraper`) Actor

Douyin 抖音 videos by video link or by keyword search, one row each. $0.70 per 1,000 videos. Caption, publish date, author, sound, hashtags, likes, comments, shares, saves, cover and a direct video link; optional MP4 files and date and length filters. No login or cookies needed.

- **URL**: https://apify.com/luzivanlt/douyin-search-scraper.md
- **Developed by:** [Luzi](https://apify.com/luzivanlt) (community)
- **Categories:** Social media, Videos, Marketing
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 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 Video Scraper: Links & Keywords

Get any Douyin video by its link, or the videos Douyin ranks for a keyword:
caption, publish date, author, sound, hashtags, likes, comments, shares,
saves, cover and a direct video link. One row per video. Optionally save the
MP4 files themselves. No Douyin account or cookies needed.

Tested end to end on 2026-11-15: 95 of 95 video links read in 2.5 minutes, and
the three-keyword sample returned 28 videos in about two minutes.

### What does this Actor do?

There are two ways in, and both save the same row.

**By video link.** Paste Douyin video links or the video ids themselves, one
per line. Each video is read on its own and saved as one row, with no keyword
and no search position. This is the direct route when you already know which
videos you want, and it is the cheapest: about a second per video.

**By keyword.** Type keywords, one per line, or Douyin search links. It reads
each keyword's search results and saves every video card it finds as one row,
with the video's rank on that search screen. It stops when every keyword is
read, or at the limits you set.

A run with both reads every video link first, then the keywords.

The search screen Douyin serves holds about 1 to 15 video cards per keyword.
This Actor reads that screen as it is; it does not page past it. The exact
number changes by keyword and by the exit the request takes, so a keyword can
return 6 videos one day and 11 the next.

You can sort the saved videos and keep only the ones you want by publish date
or length. Filters run on the video in hand, before **Max videos per
keyword**; **rank** always stays the video's position on the search screen.

Each video comes with:

- **Where it places:** its rank on the search screen and the keyword it was
  found for, when it came from a search. Both are empty for a video you gave
  by link.
- **The video:** caption, post type, publish time, whether it is pinned, its
  length and quality label, and its page link.
- **The author:** name, numeric id, handle, bio, verified badge and avatar.
- **The sound:** title, credited artist and length.
- **Topics:** every hashtag in the caption and every topic Douyin attaches.
- **Engagement:** likes, comments, shares and saves.
- **Media:** a cover image with its size, a direct link to the video file and
  a second direct link when Douyin serves one.
- **The file, when you ask for it:** turn on **Download video files** and the
  MP4 is saved with the row's key and size.

### Why use it?

- **Two ways in, one kind of row.** A video link or a keyword both give the
  same 79 fields, so you can mix them in one run and export one file.
- **Rank is part of the row.** The first result for `美食` and the tenth are
  different ranks, not one undifferentiated list, so you can compare placement
  across keywords or over time.
- **A video link costs a fraction of a search.** 95 links took 2.5 minutes and
  were charged as 95 videos only: no keyword price, no search screen to read.
- **Priced under every measured rival.** $0.70 per 1,000 videos and $3.80 per
  1,000 keywords that return videos: about $1.15 per 1,000 videos at the usual
  8 videos per keyword, and never more than $4.50 even at one video per
  keyword. Search rivals charge $4.50 to $6.99 per 1,000 videos and up to $20
  per 1,000 keywords. A run costs $0.0004 to start, so a one-video run costs
  $0.0011 rather than the $0.0005 of platform time it uses.
- **No login, no cookies, no China IP.** Give it links or keywords and press
  Start.
- **One row, 79 fields.** The author, sound, topics and engagement come with
  the video; there is no second run and no add-on event. The MP4 itself is one
  tick-box away when you need the file.
- **Filters and sorting built in.** Keep only videos from a date onward, or
  within a length range, and sort by newest, most liked or most commented.
  Filters run before a video is saved, so one left out is never charged.
- **Export as JSON, CSV or Excel,** or pull the same rows through Apify's API
  into your own tool.

### How to use it

1. Paste Douyin video links into **Video links or ids**, one per line, or type
   one keyword per line into **Keywords**, in Chinese or English.
2. Optionally set **Sort saved videos**, **Published after**, **Minimum
   length (seconds)** or **Maximum length (seconds)** to reorder or trim the
   videos.
3. Optionally set **Max videos per keyword** and **Max keywords** to cap the
   keyword part of the run.
4. Turn on **Download video files** if you need the MP4s, not only the links.
5. Press Start. Rows appear in the dataset as each link or keyword is read.

Run with no changes and the Actor reads three popular Chinese keywords: 美食,
猫 and 奶茶.

#### Links that work

Video links, one video each:

- `https://www.douyin.com/video/7575086610825178363`
- `https://www.iesdouyin.com/share/video/7575086610825178363/`
- `7575086610825178363` (the id on its own)

A short `v.douyin.com` link is accepted, but those links expire: a stale one
lands on Douyin's home page, so that line is reported as unread and is not
charged. Use the full video link or the id when you have it.

Search links, one keyword each:

- `https://www.douyin.com/search/coffee`
- `https://www.douyin.com/search/%E7%8C%AB` (猫)

A link to anything other than a Douyin video or search stops the run before
anything is read and names the line, so a typo never costs you a partial run.
A Douyin profile link is refused for the same reason: profiles are not part of
this Actor, and their pages carry nothing to save. The filters in a search
link are ignored: this Actor reads the general video results.

### Input

| Title | What it does | Default |
| --- | --- | --- |
| **Video links or ids** (`videoLinks`) | One Douyin video link or video id per line, up to 1,000. Each video is read on its own and saved as one row with an empty keyword and rank. A line that is not a video link stops the run before anything is read. | Empty |
| **Keywords** (`keywords`) | One keyword per line, or a Douyin search link. Chinese and English both work. Up to 50 lines; a line that is neither stops the run before anything is read. | Empty, which runs the three-keyword sample when there are no video links |
| **Sort saved videos** (`sortBy`) | Search order keeps the Douyin ranking. Newest first, most liked first and most commented first reorder the videos saved for each keyword. | Search order |
| **Published after** (`publishedAfter`) | Keeps only videos published on or after this day, in China time, such as `2026-01-01`. Empty keeps every date. A video without a date is kept. | Empty |
| **Minimum length (seconds)** (`minDurationSeconds`) | Keeps only videos at least this long. 0 keeps every length. A video without a length is kept. | 0 |
| **Maximum length (seconds)** (`maxDurationSeconds`) | Keeps only videos at most this long. 0 keeps every length. Must not be smaller than the minimum. | 0 |
| **Max videos per keyword** (`maxVideosPerKeyword`) | Keyword runs only. Saves at most this many videos for each keyword, in search order. 0 saves every video the search shows. A keyword usually shows 5 to 10; 1 to 15 has been measured. | 0 |
| **Max keywords** (`maxKeywords`) | Keyword runs only. Reads at most this many keywords, in the order you gave them. 0 reads every keyword. | 0 |
| **Download video files** (`downloadVideos`) | Saves each video's MP4 to the run's key-value store and adds its key and size to the row. Charged separately at $0.0021 per 10 MB block and about 5 to 20 seconds slower per video. Files up to 50 MB are saved; a larger one keeps its links and is not charged. | Off |

Give at least one video link or keyword, or leave both empty to run the sample.

```json
{
  "videoLinks": [
    "https://www.douyin.com/video/7575086610825178363",
    "7676392812702633262"
  ],
  "keywords": ["美食", "猫", "https://www.douyin.com/search/coffee"],
  "sortBy": "newest",
  "publishedAfter": "2026-01-01",
  "maxVideosPerKeyword": 10,
  "maxKeywords": 50,
  "downloadVideos": false
}
```

### Output

One row per video. A video you gave by link has an empty `keyword` and `rank`;
every other field is filled the same way as a search result. Every field is
listed below the example; the example is shortened:

```json
{
  "keyword": "美食",
  "rank": 1,
  "aweme_id": "7676392812702633262",
  "url": "https://www.douyin.com/video/7676392812702633262",
  "share_url": "https://www.iesdouyin.com/share/video/7676392812702633262/...",
  "desc": "厨房小白也能学的腌菜教程，步骤简单易懂，轻松做出下饭美味 #泡菜教程 #厨房新手",
  "created_at": "2026-08-21T08:04:43.000Z",
  "created_at_unix": 1787299483,
  "is_pinned": false,
  "aweme_type": 0,
  "preview_title": "厨房小白也能学的腌菜教程，步骤简单易懂…",
  "desc_language": "zh",
  "media_type": 4,
  "region": "CN",
  "city_code": "350100",
  "author_id": "2700824178603399",
  "author_short_id": "94995534488",
  "author_unique_id": "94995534488",
  "author_nickname": "萌梓图书",
  "author_signature": "",
  "author_verified": true,
  "author_sec_uid": "MS4wLjABAAAA...",
  "author_verification_type": 1,
  "author_region": "CN",
  "author_language": "zh-Hans",
  "author_avatar_url": "https://p3-sign.douyinpic.com/...",
  "music_id": "7575086604218436415",
  "music_title": "@萌梓图书创作的原声",
  "music_author": "萌梓图书",
  "music_duration_seconds": 9,
  "music_is_original": false,
  "music_owner_id": "2700824178603399",
  "music_owner_handle": "94995534488",
  "music_owner_nickname": "萌梓图书",
  "music_user_count": 0,
  "music_collect_count": 0,
  "hashtags": ["泡菜教程", "厨房新手"],
  "challenges": ["泡菜教程"],
  "digg_count": 63,
  "comment_count": 1,
  "share_count": 0,
  "collect_count": 21,
  "play_count": 0,
  "download_count": 1,
  "forward_count": 0,
  "video_duration_ms": 235000,
  "video_ratio": "720p",
  "video_url": "https://v3-dymsearch.douyinvod.com/...",
  "video_file_key": "video-7676392812702633262.mp4",
  "video_file_bytes": 8123456,
  "video_width": 1080,
  "video_height": 1440,
  "video_format": "mp4",
  "video_is_h265": false,
  "video_has_watermark": true,
  "video_h264_url": "https://v3-dymsearch.douyinvod.com/...",
  "video_h265_url": "https://v3-dymsearch.douyinvod.com/...",
  "origin_cover_url": "https://p9-sign.douyinpic.com/...",
  "dynamic_cover_url": "https://p26-sign.douyinpic.com/...",
  "download_url": "https://v3-dymsearch.douyinvod.com/...",
  "cover_url": "https://p26-sign.douyinpic.com/...",
  "cover_width": 1080,
  "cover_height": 1440,
  "allow_share": true,
  "allow_comment": true,
  "can_share": true,
  "can_comment": true,
  "scraped_at": "2026-11-14T19:56:50.000Z"
}
```

| Field | What it holds |
| --- | --- |
| `keyword` | The keyword this video was found for; empty when the video came from a link. |
| `rank` | The video's position among the video results for that keyword, starting at 1; empty when the video came from a link. |
| `aweme_id` | Douyin's own id for the video. |
| `url` | The video's page on Douyin. |
| `share_url` | The share link Douyin builds for the video. |
| `desc` | The caption the poster wrote, with hashtags in place. |
| `preview_title` | A shortened title Douyin shows for the video, when the card carries one. |
| `desc_language` | The language the caption is written in, as Douyin labels it. |
| `created_at` | When the video was posted, as an ISO 8601 timestamp. |
| `created_at_unix` | The same publish time in Unix seconds. |
| `is_pinned` | True when the poster pinned this video to the top of their profile. |
| `aweme_type` | Douyin's own post type code; 68 is an image gallery, most others are video. |
| `media_type` | Douyin's own media type code; 4 is a video. |
| `region` | The region Douyin records for the video, such as CN. |
| `city_code` | Douyin's numeric city code; the search card does not carry the city name. |
| `author_id` | Douyin's numeric id for the poster. |
| `author_sec_uid` | A stable author id used in Douyin profile links. |
| `author_short_id` | The short numeric id Douyin shows as the account's number. |
| `author_unique_id` | The account handle, when the poster has set one. |
| `author_nickname` | The name the poster shows. |
| `author_signature` | The text in the poster's profile bio. |
| `author_verified` | True when Douyin shows a verified badge on the account. |
| `author_verification_type` | Douyin's verification code for the account; 0 means none. |
| `author_region` | The region on the author's profile. |
| `author_language` | The language on the author's profile. |
| `author_avatar_url` | Link to the poster's profile picture. |
| `author_avatar_168_url` | Link to the author's profile picture at 168 by 168 pixels. |
| `author_avatar_300_url` | Link to the author's profile picture at 300 by 300 pixels. |
| `author_avatar_large_url` | Link to the author's profile picture at 1080 by 1080 pixels. |
| `music_id` | Douyin's id for the sound used in the video. |
| `music_title` | The name of the sound used in the video. |
| `music_author` | The artist or account credited for the sound. |
| `music_duration_seconds` | The sound's length in seconds. |
| `music_is_original` | True when the sound is the creator's original. |
| `music_is_commerce` | True when Douyin marks the sound for commercial use. |
| `music_owner_id` | Douyin's id for the account that owns the sound. |
| `music_owner_handle` | The handle of the account that owns the sound. |
| `music_owner_nickname` | The name of the account that owns the sound. |
| `music_sec_uid` | A stable id for the account that owns the sound. |
| `music_user_count` | How many videos use the sound, as the card reports it. |
| `music_collect_count` | How many people saved the sound, as the card reports it. |
| `music_cover_url` | Link to the sound's cover image. |
| `hashtags` | Every hashtag in the caption, without the # sign. |
| `challenges` | The Douyin topics the video is attached to. |
| `digg_count` | Likes on the video, as shown with the result. |
| `comment_count` | Comments on the video, as shown with the result. |
| `share_count` | Shares of the video, as shown with the result. |
| `collect_count` | Saves to favourites, as shown with the result. |
| `play_count` | Plays on the video, as shown with the result; 0 when the card omits the count. |
| `download_count` | Downloads of the video, as shown with the result. |
| `forward_count` | Forwards of the video, as shown with the result. |
| `video_duration_ms` | The video's length in milliseconds. |
| `video_ratio` | The resolution label Douyin gives the stream, such as 720p. |
| `video_width` | Width of the video stream in pixels. |
| `video_height` | Height of the video stream in pixels. |
| `video_format` | The container format Douyin reports, such as mp4. |
| `video_is_h265` | True when Douyin marks the default stream as H.265. |
| `video_is_bytevc1` | True when the default stream uses ByteVC1. |
| `video_is_hdr` | True when the default stream is HDR. |
| `video_has_watermark` | True when Douyin marks the video as watermarked. |
| `video_cdn_url_expires_at` | When the video link was issued, as a Unix timestamp; 0 when the card does not say. |
| `video_url` | A direct link to the video file, when Douyin serves one. |
| `video_file_key` | The key of the saved MP4 in this run's key-value store; empty unless **Download video files** is on and the file was saved. |
| `video_file_bytes` | Size of the saved MP4 in bytes; empty unless the file was saved. |
| `video_h264_url` | An H.264 link to the video, when Douyin serves one. |
| `video_h265_url` | An H.265 link to the video, when Douyin serves one. |
| `download_url` | A second direct link to the video file, when Douyin serves one. |
| `video_bit_rates` | Every stream the card offers, with its quality label, bitrate, frame rate, codec and link. |
| `cover_url` | Link to the video's cover image. |
| `cover_width` | Width of the cover image in pixels. |
| `cover_height` | Height of the cover image in pixels. |
| `origin_cover_url` | Link to the untouched cover image. |
| `dynamic_cover_url` | Link to the animated cover image. |
| `is_delete` | True when Douyin marks the video as deleted. |
| `is_private` | True when the video is private. |
| `with_goods` | True when the video carries a product cart. |
| `allow_share` | True when the poster allows sharing. |
| `allow_comment` | True when the poster allows comments. |
| `can_share` | True when the video's control block allows sharing. |
| `can_comment` | True when the video's control block allows comments. |
| `scraped_at` | When this row was saved, as an ISO 8601 timestamp. |

`keyword` and `rank` are empty for a video read by link. `author_unique_id`
(about 1 in 9 rows), `author_signature` (about 1 in 26), `download_url` (about
1 in 4) and `share_count` (about 1 in 9) are sometimes empty because the page
does not carry them. Engagement counts are 0 when the page shows 0 or omits the
count.

### How much does it cost?

You pay for what you get:

- **$0.0007 per video** ($0.70 per 1,000 videos). Charged once per video saved
  to your results, whether it came from a link or from a search. A video you
  give twice, or one the search shows twice under one keyword, is charged
  once; a video left out by a filter or by **Max videos per keyword** is not
  charged.
- **$0.0038 per keyword** ($3.80 per 1,000 keywords) when the keyword adds at
  least one video to your results. A video link is never charged as a
  keyword. A keyword whose search shows no videos,
  whose videos were all filtered out, or whose videos were already saved, is
  not charged. A keyword that could not be read is not charged either.
- **$0.0021 per 10 MB block**, only when **Download video files**
  is on and the MP4 was saved. A file is charged one block per 10 MB it
  starts: a 7 MB file is one block and $0.0021, a 25 MB file is three blocks
  and $0.0063. A file that could not be saved, or one already saved in this
  run for another keyword, is not charged.
- **$0.0004 per run**, once, at one event per GB of memory. This is the Actor
  Start charge: every run spends its first seconds opening a session, and a
  run of a single video link would otherwise cost more than that one video
  covers. It is the same $0.0004 whether the run reads one link or a thousand,
  and it is not charged again per keyword.

A run of 95 video links that saves 95 videos costs $0.0669: 95 × $0.0007 plus
$0.0004, and nothing for keywords. A run of three keywords that saves 26 videos
costs $0.0300: 26 × $0.0007 = $0.0182 for the videos, plus 3 × $0.0038 =
$0.0114 for the keywords, plus $0.0004. With **Download video files** on and 26
files averaging 12 MB, the files add 52 blocks, so that run costs $0.1392.

Plan discounts: Bronze 10%, Silver 20%, Gold 30%. Videos are $0.00063,
$0.00056 and $0.00049; keywords are $0.00342, $0.00304 and $0.00266; file
blocks are $0.00189, $0.00168 and $0.00147. The Actor Start charge is the same
on every plan.

### How long does a run take?

Video links: about 8 seconds for 1 video, about 70 seconds for 50 and about
2.5 minutes for 95, so roughly 1 to 2 seconds per video. Up to 1,000 links fit
the default 1-hour timeout.

Keywords: about two minutes for 3 keywords and 9 to 12 minutes for 20 keywords
at the default settings. Each keyword takes 12 to 22 seconds when the site answers
normally; a keyword whose search shows no video cards can take about 2 minutes,
and the next keyword continues on a fresh connection. A run of the 50-keyword
maximum takes about 22 to 30 minutes at that pace; the default timeout of 1 hour
covers it. With **Download video files** on, each video adds about 5 to 20
seconds of upload time: the three-keyword sample of about 27 videos takes 3 to
10 minutes in total, and 20 keywords at 8 videos each can take 22 to 65
minutes, past the 1-hour default at the slow end. Read fewer keywords per run
when you need the files.

### Good to know

- **A video link is one video.** Links are read one at a time, about a second
  each, up to 1,000 per run. The row has no keyword and no rank, and nothing is
  charged for a keyword.
- **A video Douyin has taken down is not saved and not charged.** If the video
  was deleted, made private or is not available, the site answers with no
  record for it, that line goes into the run summary, and the run carries on
  with the next link.
- **A video can be saved twice in one run.** Once by link and once for a
  keyword that shows it, because one row carries the rank and the other does
  not. A link given twice is read once.
- **First search screen only.** Douyin serves 1 to 15 video cards on the
  first screen (usually 5 to 10), and this Actor reads that screen. There is no
  paging, so a keyword with hundreds of results still returns its first 1 to 15.
- **Filters see the first screen only.** Sort, publish date and length apply
  to the 1 to 15 cards the search returns, before **Max videos per keyword**.
  A video left out is not saved and not charged, and a keyword whose every
  video is filtered out costs nothing. A card that does not show a date or a
  length is kept, because an unknown value is not evidence against it.
- **Chinese keywords have the widest coverage.** English keywords work, but
  some return no video cards on some days; `coffee` and `nike` returned 7 to
  8 videos, `iphone` returned none on one test.
- **The same video can appear for two keywords.** It is saved once for each
  keyword, because its rank is different in each. Within one keyword it is
  saved once.
- **A restart does not pay twice.** Rows already in the dataset are skipped,
  skipped rows are not charged, and a keyword that adds no new video is not
  charged again.
- **Files are optional, priced by size and capped at 50 MB each.** Without
  **Download video files** the row carries direct video and cover links and
  nothing is stored. With it on, each MP4 goes to the run's key-value store
  under `video-<id>.mp4`; a video larger than 50 MB keeps its links and no
  file, and is not charged. The store follows the run's retention: a run's own
  store is usually deleted 7 days after the run. Each file takes 5 to 17
  seconds to save, so a download run with many keywords can reach the 1-hour
  timeout; use fewer keywords or a longer timeout.
- **A run that needs longer than its timeout stops early** and reports how
  many keywords it read. The default timeout is 1 hour.
- **Videos only.** Profiles, comments, products and hashtag pages are not part
  of this Actor, and a profile link stops the run rather than returning
  nothing.

### FAQ

**Do I need a Douyin account or cookies?**
No. There is no login and no account, so there is no account to lose.

**How many videos will one keyword return?**
Usually 5 to 10, in a measured range of 1 to 15, depending on the keyword and
the connection. The number is the site's first screen, not a limit this Actor
adds.

**Can I get more than 15 videos for a keyword?**
Not yet. Reading further would need a signed request this Actor does not
make; the first screen is what it can read reliably.

**Does it download the video files?**
Only if you turn on **Download video files**. Each MP4 is saved to the run's
key-value store, its key and size are added to the row, and the file is charged
by size at $0.0021 per 10 MB block. Leave the option off and each row still has
direct video links you can download yourself, at no extra charge.

**Can I give a user or profile link?**
No. Profile links are refused, because a profile page carries no video record
to save. A profile's videos can be reached one by one as video links.

**Can I get a video without the watermark?**
No. The links and the optional MP4 are what Douyin serves to a logged-out
visitor; the record says whether Douyin marks that video as watermarked.

**Can I search users, hashtags or products?**
No, this Actor reads videos only.

**Do English keywords work?**
Yes, with narrower coverage. Chinese keywords returned videos on every test;
some English keywords returned none on one test and rows on another.

**Can I get only recent videos, or only long ones?**
Yes. Set **Published after** to the first day you want, and **Minimum length
(seconds)** to 60 for videos of a minute or more. Filters narrow the cards the
search already shows; they do not fetch older videos the search left out.

**Why is a like or share count 0?**
The search card showed 0, or did not carry the number. The row keeps what the
card shows rather than guessing.

**Can I run it on a schedule?**
Yes. Add a schedule and put your keywords in the task input; each run saves
that day's ranking for the same terms.

# Changelog

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

# Actor input Schema

## `videoLinks` (type: `array`):

One Douyin video link or video id per line: https://www.douyin.com/video/7575086610825178363, a v.douyin.com short link, or the 19-digit id on its own. Up to 1,000 lines. Each video is one plain request of about a second and is charged once; a video the site has deleted or hidden is not charged. A line that is not a Douyin video link stops the run before anything is read.

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

One keyword per line, or a Douyin search link such as https://www.douyin.com/search/coffee. Chinese and English both work. Up to 50 lines; a line that is neither a keyword nor a Douyin link stops the run before anything is read.

## `sortBy` (type: `string`):

Order of the videos saved for each keyword. "Search order" keeps the Douyin ranking. The other options reorder the videos that keyword's search shows; every row keeps the search position it had on the site.

## `publishedAfter` (type: `string`):

Keep only videos published on or after this day, in China time, such as "2026-01-01". Leave empty to keep every date. A video whose date the site does not show is kept.

## `minDurationSeconds` (type: `integer`):

Keep only videos at least this long. 0 keeps every length. A video whose length the site does not show is kept.

## `maxDurationSeconds` (type: `integer`):

Keep only videos at most this long. 0 keeps every length. Must not be smaller than the minimum.

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

Save each video's MP4 to this run's key-value store and add its key and size to the row. Charged separately at $0.0021 per 10 MB block and slower, about 5 to 20 seconds per video. Files up to 50 MB are saved; a larger one keeps its links and is not charged.

## `maxVideosPerKeyword` (type: `integer`):

Search only. Save at most this many videos for each keyword, in search order. 0 saves every video the search shows. A keyword usually shows 5 to 10; 1 to 15 has been measured.

## `maxKeywords` (type: `integer`):

Search only. Read at most this many keywords, in the order given. 0 reads every keyword. The list itself holds up to 50.

## Actor input object example

```json
{
  "keywords": [
    "美食",
    "猫",
    "奶茶"
  ],
  "sortBy": "search-order",
  "publishedAfter": "",
  "minDurationSeconds": 0,
  "maxDurationSeconds": 0,
  "downloadVideos": false,
  "maxVideosPerKeyword": 0,
  "maxKeywords": 0
}
```

# Actor output Schema

## `videos` (type: `string`):

One row per video in the default dataset; open the link for the overview view.

# 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": [
        "美食",
        "猫",
        "奶茶"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("luzivanlt/douyin-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 = { "keywords": [
        "美食",
        "猫",
        "奶茶",
    ] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,luzivanlt/douyin-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/1rFwKN0VLKhS2VZqt/builds/zhxxp6g8TaNWWvF46/openapi.json
