# Douyin Scraper 抖音 \[Only $3] Search, Videos, Comments & Profiles (`memo23/douyin-scraper`) Actor

\[Only $3 per 1000 results] Scrape Douyin (抖音, China's TikTok) with no login or cookies: keyword search, full video detail (likes, shares, collects, comments, author, music, hashtags, download URLs), image posts, creator profiles and comments. Clean JSON.

- **URL**: https://apify.com/memo23/douyin-scraper.md
- **Developed by:** [Muhamed Didovic](https://apify.com/memo23) (community)
- **Categories:** Social media, Videos, AI
- **Features:** Limited permissions
- **Stats:** 390 total users, 163 monthly users, 93.6% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $3.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.

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 — Video, Profile & Comments Data

Extract structured data from **Douyin (抖音)** — China's original TikTok, with ~750M daily users — with no login, account or cookies needed. Paste video or creator URLs and get back clean JSON: full video metrics, creator profiles, and comment threads.

Great for **market research, influencer discovery, trend tracking, brand monitoring, and competitive analysis** on the Chinese short-video market.

![How the Douyin Scraper works](https://raw.githubusercontent.com/muhamed-didovic/muhamed-didovic.github.io/main/assets/how-it-works-douyin.png)

***

### 中文说明

**抖音数据采集，无需登录、无需账号、无需 Cookie。** 粘贴视频或博主链接，或输入关键词，即可获得结构化 JSON：

- 视频详情：点赞、评论、分享、收藏数，真实播放量，话题标签，音乐，封面和视频下载链接
- 博主主页：粉丝数、关注数、获赞总数、作品数、简介、认证信息、IP 属地；以及博主发布的作品
- 评论和回复（含 IP 属地）、弹幕、相关推荐视频
- 关键词搜索视频（可按综合、最多点赞、最新排序，按发布时间和时长筛选）、搜索博主、图文搜索
- 话题视频、音乐和使用该音乐的视频、合集、抖音热榜、频道推荐、音乐榜、品牌榜、各分类头部达人
- 可选：把视频 MP4、封面和图文图片保存到 Apify 存储

输入示例：

```json
{
  "searchKeywords": ["咖啡"],
  "maxResultsPerSearch": 100,
  "searchSort": "most_liked",
  "searchPublishTime": "one_week",
  "includeComments": true,
  "maxComments": 50
}
```

主要输出字段：视频 `awemeId`、`url`、`description`、`createTime`、`likes`、`comments`、`shares`、`collects`、`plays`、`hashtags`、`authorName`、`authorFollowers`、`coverUrl`、`downloadUrls`、`musicTitle`；博主 `nickname`、`followers`、`following`、`totalLikes`、`videoCount`、`signature`、`ipLocation`；评论 `commentId`、`text`、`likes`、`replyCount`、`ipLocation`、`userName`。

价格：按结果计费，每 1,000 条结果 $3（视频、博主、评论等每行 $0.003），每次运行启动费 $0.005，保存视频文件每个 $0.002。没有返回的数据不收费，可用 `maxItems` 或运行选项中的费用上限控制花费。

***

### What it does

| Mode | Input | You get |
|------|-------|---------|
| 🎬 **Video detail** | a video URL | Full post: likes, shares, collects, comment count, author, music, hashtags, cover, video & download URLs, dimensions |
| 👤 **Creator profile** | a user URL | Followers, following, total likes, video count, bio, verification, avatar, IP region |
| 💬 **Comments** | a video URL + toggle | Comment text, likes, reply counts, commenter, IP region |
| 🔎 **Keyword search** | keywords | Videos matching a search term, with sort, date and length filters |
| #️⃣ **Hashtag videos** | hashtag names or ids | A hashtag's videos, each with the hashtag's total view count |
| 🧑‍🤝‍🧑 **Creator search** | keywords | Creators matching a name or topic, with followers, likes and post count |
| 🔥 **Hot search board** | a toggle | The live 抖音热榜: about 50 ranked terms plus rising ones, with heat values |
| ↩️ **Replies** | comments + toggle | Replies under each comment, linked by `parentCommentId` |
| 📹 **Creator's videos** | a user URL + toggle | A creator's posted videos, newest first |
| ▶️ **Real play counts** | a toggle | The real `plays` number on every video row, which Douyin's own video data no longer shows |
| 🎵 **Music** | keywords, links or ids | Songs and sounds with their use counts, and the videos that use a song |
| 🗂️ **Collections (合集)** | links or ids | A collection's total plays and episode count, then its videos in order |
| 💭 **Bullet comments (弹幕)** | a video URL + toggle | Each bullet comment with its moment in the video and likes |
| 🔁 **Related videos** | a video URL + toggle | The videos Douyin recommends next to a video |
| 🖼️ **Image-post search** | keywords | Image posts (图文) matching a keyword |
| 📺 **Category feeds** | a selection | Fresh videos from the food, knowledge, gaming, anime and music channels |
| 📈 **Charts** | a selection | Music charts, creator-centre charts with play counts, the promoted-video ranking |
| 🏷️ **Brand rankings** | a selection | The weekly brand ranking of 13 categories, 30 brands each |
| 🏆 **Top creators by category** | a selection | The largest creators of 34 content categories |

Everything works **out of the box, with no account and no cookie**: videos, profiles, comments, keyword search and creator catalogs.

***

### Input

| Field | Type | Description |
|-------|------|-------------|
| `startUrls` | array | Douyin video URLs, creator-profile URLs, short `v.douyin.com` links, or bare IDs. Video URLs → post detail; user URLs → profile. |
| `includeComments` | boolean | For each video URL, also scrape its comments. |
| `maxComments` | integer | Max comments per video (default 50). |
| `includeReplies` / `maxRepliesPerComment` | boolean / integer | Replies under each comment as `reply` rows (default 20 per comment). They do not count toward `maxComments`. |
| `includeUserPosts` | boolean | For each creator URL, also scrape their posted videos. |
| `maxUserPosts` | integer | Max videos per creator (default 30). |
| `searchKeywords` | array | Keyword video search. Chinese, English, hashtags and brand names. Duplicates across keywords are removed. |
| `maxResultsPerSearch` | integer | Max results per keyword (default 30, up to 2,000; `0` = as many as the search returns). |
| `searchSort` | string | `general` (relevance), `most_liked` or `latest`. |
| `searchPublishTime` | string | `unlimited`, `one_day`, `one_week` or `half_year`. |
| `searchDuration` | string | `unlimited`, `under_1m`, `one_to_five` or `over_5m`. |
| `hashtags` / `maxResultsPerHashtag` | array / integer | Hashtag names (`咖啡`, `#咖啡`) or ids; videos per hashtag (default 30). |
| `creatorKeywords` / `maxCreatorsPerKeyword` | array / integer | Find creators by keyword (default 30 per keyword). |
| `includeHotSearch` | boolean | The live hot search board as `hot-search` rows. |
| `includePlayCounts` | boolean | Fill `plays`, `statistics.playCount` and `statistics.downloadCount` with the real numbers on every video row. No extra charge per row. |
| `includeDanmaku` / `maxDanmakuPerVideo` | boolean / integer | Bullet comments of each video given by link, as `danmaku` rows (default 100 per video). |
| `includeRelatedVideos` / `maxRelatedPerVideo` | boolean / integer | Recommended videos for each video given by link (default 10); rows carry `relatedToAwemeId`. |
| `musicKeywords` / `maxMusicPerKeyword` | array / integer | Find songs and sounds by keyword, as `music` rows (default 10 per keyword). |
| `musicUrls` / `maxVideosPerMusic` | array / integer | Music links or ids: the song, then videos that use it (default 20; `0` = the song only). |
| `collectionUrls` / `maxVideosPerCollection` | array / integer | Collection links or ids: a `collection` row, then its videos (default 30). |
| `imageKeywords` | array | Image-post search; uses `maxResultsPerSearch`. |
| `feeds` / `maxResultsPerFeed` | array / integer | `food`, `knowledge`, `game`, `cartoon`, `music` (default 20 videos each). |
| `trendLists` | array | `musicHot`, `musicTrending`, `musicOriginal`, `creatorHotVideos`, `creatorHotTopics`, `creatorHotMusic`, `creatorHotProps`, `promotedVideos`. |
| `brandRankings` | array | `cars`, `phones`, `beauty`, `luxury`, `foodAndDrinks`, `homeAppliances`, `fashion`, `motherAndBaby`, `personalCare`, `games`, `health`, `restaurants`, `travel`. |
| `talentCategories` / `maxTalentsPerCategory` | array / integer | Content categories in Chinese as shown in the input form (`美食`, `旅行`, `游戏` …); default 20 creators each. |
| `downloadVideos` | boolean | Save each video's MP4 to a key-value store; the row gets `videoFile`. Billed per saved file. |
| `downloadCovers` | boolean | Save cover images (`coverFile`). No extra charge. |
| `downloadSlideshowImages` | boolean | Save every slide of image posts (`slideshowFiles`). No extra charge. |
| `mediaKvStoreName` | string | Named key-value store that keeps the files across runs. Empty: the run's default store. |
| `maxVideoSizeMb` | integer | Skip videos above this size (default and maximum 40). The saved file is the best quality under 25 MB; `videoMeta.bitRates` links every quality. |
| `douyinCookie` | string | Optional. With a logged-in cookie, search and creator videos run on your own session (the search filters do not apply there). |
| `maxItems` | integer | Global cap on total results. |
| `proxyConfiguration` | object | Optional. The default works out of the box; add your own proxy (residential recommended) only if you prefer. |

#### Example input

```json
{
  "startUrls": [
    { "url": "https://www.douyin.com/video/7615930241370348219" },
    { "url": "https://www.douyin.com/user/MS4wLjABAAAAUT_tvNpyI5-tObkvU2xaaqyeDpek5UJXLG8mePjYxTQ" }
  ],
  "includeComments": true,
  "maxComments": 100,
  "maxItems": 500
}
```

#### Example: keyword search

The most-liked videos of the last week for two keywords:

```json
{
  "searchKeywords": ["咖啡", "#美食"],
  "maxResultsPerSearch": 200,
  "searchSort": "most_liked",
  "searchPublishTime": "one_week"
}
```

Each search row carries `searchKeyword` and `searchPosition`. The input names `keywords`, `maxResultsPerQuery`, `sort`, `publishTime` and `duration` are accepted too, so an input written for another Douyin search actor runs unchanged.

***

### Output

Every row carries a `type` field (`video`, `user`, `comment`, `reply` or `hot-search`) so you can filter mixed runs.

#### Video

```json
{
  "type": "video",
  "awemeId": "7615930241370348219",
  "url": "https://www.douyin.com/video/7615930241370348219",
  "isImagePost": false,
  "description": "夜宵简单吃个长沙滋啦冒油的炭烤牛肋排… #长沙美食",
  "createTime": "2026-03-11T09:39:01.000Z",
  "duration": 12600,
  "hashtags": ["饭搭子", "深夜放毒", "寻味烟火气", "长沙美食"],
  "likes": 139023,
  "comments": 11025,
  "shares": 598443,
  "collects": 13776,
  "authorName": "章章干嘛呢",
  "authorSecUid": "MS4wLjABAAAAUT_tvNpyI5-tObkvU2xaaqyeDpek5UJXLG8mePjYxTQ",
  "authorFollowers": 62679,
  "coverUrl": "https://...",
  "videoUrls": ["https://...", "..."],
  "downloadUrls": ["https://...", "..."],
  "width": 1080,
  "height": 1920,
  "musicTitle": "@章章干嘛呢创作的原声",
  "shareUrl": "https://..."
}
```

Every video row also carries grouped detail next to the flat columns above:

| Group | Fields |
|-------|--------|
| `authorMeta` | `id`, `secUid`, `name`, `username`, `signature`, `verified`, `enterpriseVerifyReason`, avatars, `followersCount`, `followingCount`, `totalLikesReceived`, `awemeCount`, `gender`, `userAge`, `school`, `isLiving`, `withShopEntry` |
| `videoMeta` | `duration`, `width`, `height`, `ratio`, `format`, `playUrl`, `playUrlH264`, `playUrlH265`, `downloadUrl`, `cover`, `originCover`, `dynamicCover`, `cdnUrlExpiresAt`, `bitRates[]` (quality, bitrate, fps, URL) |
| `musicMeta` | `id`, `title`, `author`, `album`, `isOriginal`, `duration`, owner fields, `playUrl`, covers, `userCount` |
| `statistics` | `diggCount`, `commentCount`, `shareCount`, `collectCount`, `playCount`, `downloadCount`, `forwardCount`, `recommendCount` |
| `permissions` | `canDownload`, `canDuet`, `canStitch`, `canShare`, `canComment`, `isPrivate`, `isDeleted`, `withGoods` |
| Other | `title`, `caption`, `mediaType`, `language`, `region`, `ipLocation`, `isPinned`, `isAd`, `hashtagDetails[]` (id, name), `mentions[]`, `videoTags[]`, `location`, `series` |

Douyin leaves some of these empty on search results (creator follower counts most often); open the creator URL for the full profile. Media URLs are signed by Douyin and expire, see `videoMeta.cdnUrlExpiresAt`. Image links (`coverUrl`, `images`, comment `images`) are JPEG; a cover link lasts from two weeks to ten years depending on where it came from, a slide about four weeks, a comment picture about a day. Turn on `downloadCovers` / `downloadSlideshowImages` for copies that do not expire.

#### Creator profile

```json
{
  "type": "user",
  "secUid": "MS4wLjABAAAA...",
  "nickname": "章章干嘛呢",
  "uniqueId": "6346717",
  "signature": "在我喜欢的状态里记录我喜欢的生活🤳 美食｜看展｜旅游",
  "verified": false,
  "followers": 49659,
  "following": 304,
  "totalLikes": 5130107,
  "videoCount": 370,
  "avatarUrl": "https://...",
  "ipLocation": "湖南",
  "url": "https://www.douyin.com/user/MS4wLjABAAAA..."
}
```

#### Comment

```json
{
  "type": "comment",
  "awemeId": "7615930241370348219",
  "commentId": "7615932448664650533",
  "text": "已观，饿之，邀好友观之，共难受之。",
  "createTime": "2026-03-11T09:47:36.000Z",
  "likes": 2970,
  "replyCount": 1161,
  "ipLocation": "湖南",
  "userName": "yuki小蛋堡🍔",
  "userSecUid": "MS4wLjABAAAA...",
  "userUrl": "https://www.douyin.com/user/MS4wLjABAAAA..."
}
```

***

### Use cases

- **Influencer & KOL discovery** — pull follower counts, engagement, and bios to build creator shortlists for the China market.
- **Trend & hashtag tracking** — monitor how videos and topics accumulate likes, shares, and comments over time.
- **Brand & sentiment monitoring** — collect comment threads on videos mentioning your brand or product.
- **Competitive analysis** — benchmark competitors' creator accounts and content performance.
- **Content research** — gather hashtags, music, and formats that perform in a niche.

***

### FAQ

**Do I need a Douyin account?**
No. Videos, creator profiles, comments, keyword search and creator catalogs all work with no login.

**Why is `plays` empty, and how do I fill it?**
Douyin stopped sending play counts with its video data, so `plays` is empty by default. Turn on `includePlayCounts` and every video row gets the real number, at no extra charge per row.

**Where do I find a music or collection id?**
Video rows carry them: `musicMeta.musicId` for the sound, `series` for the collection. Links like `douyin.com/music/…` and `douyin.com/collection/…` work too.

**Can it download the videos?**
Yes. Turn on `downloadVideos` and each MP4 is saved to a key-value store, with its link in the row's `videoFile`. A download is charged only when the file was saved; image posts, failed downloads and videos above `maxVideoSizeMb` (40 MB, roughly a 5-minute video) are not charged; their rows still carry direct links in `videoMeta`. Cover images and slideshow images are saved at no extra charge. Works with search results, creator videos and single video links.

**Can I use my own cookie?**
Yes, it is optional. Log in to `douyin.com` in your browser, open DevTools → Network, click any `douyin.com` request, and copy the full `Cookie` request header into the `douyinCookie` field.

**Do I need to set up a proxy?**
No. The default works out of the box. You can add your own proxy (residential recommended) if you prefer.

**What time zone are the dates?**
All `createTime` values are ISO 8601 UTC.

**Can I get the raw video / image files?**
The output includes direct `videoUrls` / `downloadUrls` / `coverUrl` / `images` links you can download from while Douyin's signature is valid (see above). For lasting copies, turn on `downloadVideos`, `downloadCovers` or `downloadSlideshowImages`: the files are saved to a key-value store as JPEG and MP4, slides without Douyin's watermark.

***

### Support

Found a missing field or a URL format that isn't recognized? Open an issue on the actor's **Issues** tab with an example URL and it'll be added.

***

### 🤖 For AI Agents & LLM Apps

Compact reference for AI agents calling this actor via the [Apify MCP server](https://mcp.apify.com) or the Apify API (actor: `memo23/douyin-scraper`).

**Purpose:** Extract Douyin (抖音) video metrics, creator profiles, and comment threads as structured JSON from video or user URLs — no login required for videos, profiles, and comments.

**Minimal input:**

```json
{
    "startUrls": [{ "url": "https://www.douyin.com/video/7615930241370348219" }],
    "maxItems": 25
}
```

Add `"includeComments": true` (with `maxComments`) to also pull each video's comments. `searchKeywords` (with `searchSort`, `searchPublishTime`, `searchDuration`) and `includeUserPosts` need no cookie.

**Output:** each row carries a `type` field. type=video: awemeId, url, isImagePost, description, createTime, duration, hashtags, likes, comments, shares, collects, authorName, authorSecUid, authorFollowers, coverUrl, videoUrls, downloadUrls, width, height, musicTitle, shareUrl, plus grouped objects authorMeta, videoMeta (H.264/H.265 play URLs, bitrates, URL expiry), musicMeta, statistics, permissions, hashtagDetails, mentions, videoTags, location; search rows add searchKeyword and searchPosition. type=user: secUid, nickname, uniqueId, signature, verified, followers, following, totalLikes, videoCount, avatarUrl, ipLocation, url. type=reply: the comment columns plus parentCommentId. type=hot-search: board (hot or rising), rank, word, hotValue, videoCount, searchUrl. type=user with source=search (from creatorKeywords): secUid, url, nickname, followers, totalLikes, videoCount. type=music: musicId, url, title, author, durationSec, videoCount, playUrl; chart rows add list, rank, heat. type=collection: collectionId, name, plays, collects, episodes, authorName. type=danmaku: awemeId, text, offsetMs, likes. type=trend: list, rank, title, itemId, url, plays, likes, comments, shares, videosPublished; promotedVideos rows have newPlays, newLikes, newFollowers, completionRate. type=brand: category, rank, rankChange, name, heat, accountUrl. type=user with source=category (from talentCategories): rank, secUid, nickname, followers, signature. type=comment: awemeId, commentId, text, createTime, likes, replyCount, ipLocation, userName, userSecUid, userUrl.

**Behaviors an agent should know:**

- Set `maxItems` to cap total rows across the run; leave empty for no cap.
- Nothing needs a cookie. Keyword search stops a keyword early when further pages return almost no new videos.
- `plays` is null unless `includePlayCounts` is true. Bullet comments and related videos apply to videos given in `startUrls`.
- `startUrls` accepts video URLs, user URLs, short `v.douyin.com` links, or bare IDs; video URLs return post detail, user URLs return the profile.
- `maxComments` (default 50), `maxUserPosts` (default 30), and `maxResultsPerSearch` (default 30) bound per-source collection.
- No proxy setup is needed; the default works out of the box.
- Billing: Pay-per-event billing — see the Pricing tab on the actor page.

***

### ⚠️ Disclaimer

This Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by Douyin Vision Co., Ltd. or its parent ByteDance Ltd. All trademarks mentioned, including Douyin (抖音), are the property of their respective owners.

The scraper accesses only publicly available video, profile, and comment pages — no authenticated endpoints, paid features, or content behind the Douyin login wall (any cookie you supply is your own). Users are responsible for ensuring their use complies with Douyin's Terms of Service, applicable data-protection law (GDPR, CCPA, etc.), and any contractual obligations of their own organization.

***

### SEO Keywords

douyin scraper, 抖音, 抖音爬虫, 抖音数据采集, 抖音评论采集, 抖音视频下载, 抖音博主数据, 抖音热榜, scrape Douyin, douyin.com scraper, Douyin API, Apify Douyin, chinese tiktok scraper, douyin video scraper, douyin comments scraper, douyin profile scraper, short video data, influencer discovery data, kol research china, social media monitoring, trend tracking data, brand sentiment analysis, china market research, creator analytics scraper, video engagement data

# Actor input Schema

## `startUrls` (type: `array`):

Douyin video URLs, user-profile URLs, short v.douyin.com links, or bare IDs. Video URLs return full post detail; user URLs return the profile.

## `includeComments` (type: `boolean`):

For each video URL, also scrape its comments (each comment becomes its own row).

## `maxComments` (type: `integer`):

Upper bound on comments collected per video when 'Include comments' is on.

## `includeReplies` (type: `boolean`):

With comments on, also return the replies under each comment as `reply` rows linked by `parentCommentId`. Replies do not count toward 'Max comments per video'.

## `maxRepliesPerComment` (type: `integer`):

Upper bound on replies collected under one comment.

## `includeUserPosts` (type: `boolean`):

For each user-profile URL, also scrape the creator's posted videos, newest first. No cookie needed.

## `maxUserPosts` (type: `integer`):

Upper bound on videos collected per creator when 'Include user's videos' is on.

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

Keyword search, no cookie needed. Chinese, English, hashtags (`#美食`) and brand names all work. Each keyword is searched on its own and a video found by two keywords is returned once.

## `maxResultsPerSearch` (type: `integer`):

Upper bound on videos collected per search keyword. A keyword usually has a few hundred results. Set 0 for as many as the search returns.

## `searchSort` (type: `string`):

How search results are ordered.

## `searchPublishTime` (type: `string`):

Keep only search results published in this window.

## `searchDuration` (type: `string`):

Keep only search results in this length range.

## `hashtags` (type: `array`):

Hashtag names (`咖啡` or `#咖啡`) or hashtag ids. Returns the hashtag's videos; each row carries `hashtag`, `hashtagId` and the hashtag's total view count.

## `maxResultsPerHashtag` (type: `integer`):

Upper bound on videos collected per hashtag.

## `creatorKeywords` (type: `array`):

Find creators by name or topic. Each result is a `user` row with the profile link, followers, total likes and post count.

## `maxCreatorsPerKeyword` (type: `integer`):

Upper bound on creators collected per creator-search keyword.

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

Return Douyin's live hot search board (抖音热榜): about 50 ranked terms plus the rising ones, each with its heat value and video count.

## `includePlayCounts` (type: `boolean`):

Douyin no longer shows play counts in its video data. Turn this on to fill `plays` and `statistics.playCount` (plus `downloadCount`) with the real numbers on every video row. No extra charge per row.

## `includeDanmaku` (type: `boolean`):

For each video given by link, return its bullet comments as rows: text, the moment in the video, likes.

## `maxDanmakuPerVideo` (type: `integer`):

How many bullet comments to return per video, from the start of the video.

## `includeRelatedVideos` (type: `boolean`):

For each video given by link, return the videos Douyin recommends next to it.

## `maxRelatedPerVideo` (type: `integer`):

How many recommended videos to return per video. A batch holds about 10.

## `musicKeywords` (type: `array`):

Find songs and sounds by keyword. Returns title, author, duration and the number of videos using each.

## `maxMusicPerKeyword` (type: `integer`):

Songs to return per keyword (minimum 5). A page holds 10.

## `musicUrls` (type: `array`):

Douyin music links (douyin.com/music/…) or music IDs. Each returns the song, then videos that use it. Video rows carry `musicMeta.musicId`.

## `maxVideosPerMusic` (type: `integer`):

Videos to return for each song. 0 returns the song only.

## `collectionUrls` (type: `array`):

Douyin collection links (douyin.com/collection/…) or collection IDs. Each returns the collection with its total plays and episode count, then its videos in order.

## `maxVideosPerCollection` (type: `integer`):

Videos to return for each collection. 0 returns the collection only.

## `imageKeywords` (type: `array`):

Search image posts (图文) by keyword. Uses 'Max results per keyword'.

## `feeds` (type: `array`):

Return videos from Douyin's category channels. Each call brings a fresh batch of 20.

## `maxResultsPerFeed` (type: `integer`):

Videos to return for each category feed.

## `trendLists` (type: `array`):

Music charts (about 30 songs with heat), creator-centre charts of the last day (about 20 entries with play, like and publish counts) and the promoted-video ranking (about 40 videos with new plays and completion rate).

## `brandRankings` (type: `array`):

The weekly brand ranking (品牌热榜) of each chosen category: 30 brands with heat and rank change.

## `talentCategories` (type: `array`):

The top creators of each chosen content category, largest first: name, Douyin ID, followers and bio.

## `maxTalentsPerCategory` (type: `integer`):

Creators to return for each category. A page holds 20.

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

Save each video's MP4 to a key-value store and add its link to the row as `videoFile`. Billed per saved file (`video-download`); a failed download is not charged. Image posts have no MP4. The file is the best quality under 25 MB; the row's `videoMeta.bitRates` lists every quality with a direct link.

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

Save each video's cover image and add its link as `coverFile`. No extra charge.

## `downloadSlideshowImages` (type: `boolean`):

For image posts, save every slide at full size as JPEG, without Douyin's watermark, and add the links as `slideshowFiles`. The image links in the row expire after about four weeks; these copies do not. No extra charge.

## `mediaKvStoreName` (type: `string`):

Name of a key-value store to keep the files in across runs (letters, digits and dashes). Empty: the run's default store.

## `maxVideoSizeMb` (type: `integer`):

Videos above this size are skipped and not charged. The best quality under 25 MB is saved; longer videos get the smallest available variant.

## `douyinCookie` (type: `string`):

Optional. Search and creator videos work without it. If you paste a logged-in douyin.com cookie string, they run on your own session instead; the sort, date and duration filters do not apply in that mode.

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

Global cap on the number of dataset items across the entire run. Leave empty for no cap.

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

Optional. The default works out of the box; add your own proxy (residential recommended) only if you prefer.

## Actor input object example

```json
{
  "startUrls": [],
  "includeComments": false,
  "maxComments": 50,
  "includeReplies": false,
  "maxRepliesPerComment": 20,
  "includeUserPosts": false,
  "maxUserPosts": 30,
  "searchKeywords": [
    "咖啡"
  ],
  "maxResultsPerSearch": 30,
  "searchSort": "general",
  "searchPublishTime": "unlimited",
  "searchDuration": "unlimited",
  "maxResultsPerHashtag": 30,
  "maxCreatorsPerKeyword": 30,
  "includeHotSearch": false,
  "includePlayCounts": false,
  "includeDanmaku": false,
  "maxDanmakuPerVideo": 100,
  "includeRelatedVideos": false,
  "maxRelatedPerVideo": 10,
  "maxMusicPerKeyword": 10,
  "maxVideosPerMusic": 20,
  "maxVideosPerCollection": 30,
  "maxResultsPerFeed": 20,
  "maxTalentsPerCategory": 20,
  "downloadVideos": false,
  "downloadCovers": false,
  "downloadSlideshowImages": false,
  "maxVideoSizeMb": 40,
  "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 = {
    "startUrls": [],
    "searchKeywords": [
        "咖啡"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("memo23/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 = {
    "startUrls": [],
    "searchKeywords": ["咖啡"],
}

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

```

## MCP server setup

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