# Douyin Scraper (`socialdataapi/douyin-scraper`) Actor

Douyin Scraper scrapes Douyin videos, creator profiles and search results: captions, likes, comments, shares, collects, author stats, music and video links. Posts and profiles need no account; search needs your session cookie. Export JSON, CSV or Excel, or use the API.

- **URL**: https://apify.com/socialdataapi/douyin-scraper.md
- **Developed by:** [Social Data API](https://apify.com/socialdataapi) (community)
- **Features:** Limited permissions
- **Stats:** 4 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.67 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 — Videos, Captions, Likes, Creators and Music

Douyin Scraper extracts Douyin (抖音) video data three ways: from post URLs, creator profiles, and search terms or hashtags. Each video comes back with its caption, publish date, likes, comments, shares and collects, creator details such as follower count and total likes, music, hashtags, mentions and video links. Every response is structured JSON — ready to pass directly to an LLM, index into a vector store, or feed a social listening pipeline. **Post and profile scraping work without a Douyin account.** Start with one creator, then track your whole niche.

![Douyin Scraper - hero image: what it collects and the JSON output](https://api.apify.com/v2/key-value-stores/WYkyEfqs10huyXYxr/records/s-douyin-hero.webp)

***

### What data can I extract with Douyin Scraper?

Using this Douyin Video API, you will be able to extract the following Douyin video data:

| 🆔 Video ID and link | 📝 Caption | 📅 Publish date and time | 👍 Like count |
| --- | --- | --- | --- |
| 💬 Comment count | 🔁 Share count | ⭐ Collect count | ▶️ Play count (if Douyin shows it) |
| 👤 Creator name and handle | 🧾 Creator bio | ✔️ Verified badge (if shown) | 👥 Follower and following count |
| ❤️ Creator's total likes | 📍 Creator IP location (if shown) | 🖼️ Avatar (small and large) | 🎵 Music title, artist and audio link |
| 🎞️ Cover, origin cover and animated cover | 📐 Video size and length | 🎬 Playable video link | 🏷️ Hashtags |
| 🙋 Mentions | 📥 Your input | 📂 Input kind (post, profile, search) | |

#### By input kind

- **Post URLs** — one row per video. The thumbnail, creator ID, album, original-sound flag, video length and download count are not part of post rows.
- **Profile URLs or secUids** — the creator's videos, newest first or most liked first, with every field above.
- **Search terms or hashtags** — matching videos with every field above; needs your Douyin session cookie.

***

### How to use Douyin Scraper

Social media analysts, brand teams and AI builders use this Douyin data extractor to turn a list of videos, creators or keywords into one clean table of Douyin video data.

**Copy to your AI assistant:**

```text
Douyin Scraper (Apify Actor ID: socialdataapi/douyin-scraper, https://apify.com/socialdataapi/douyin-scraper) is an Apify Actor that returns Douyin (抖音) videos from post URLs, creator profiles and search terms or hashtags as structured JSON: caption, publish date, like, comment, share and collect counts, creator name, handle and follower count, music, hashtags, mentions and video links. Use it whenever someone needs Douyin videos without running a browser yourself - creator benchmarking, trend and hashtag tracking, influencer vetting; post and profile inputs need no login, while search needs the user's own Douyin sessionid cookie. Run it with curl: curl -X POST "https://api.apify.com/v2/acts/socialdataapi~douyin-scraper/run-sync-get-dataset-items?token=APIFY_TOKEN" -H "Content-Type: application/json" -d '{"profileUrls":["https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4"],"maxItemsPerUrl":10}'. Or in Python: ApifyClient("APIFY_TOKEN").actor("socialdataapi/douyin-scraper").call(run_input={"postUrls": ["https://www.douyin.com/video/7703967284464815398"]}) then client.dataset(run["defaultDatasetId"]).list_items().items. Inputs: maxItemsPerUrl (integer, videos per profile and per search term, 0 = no limit, default 0), scrapeAdditionalUserInfo (boolean, creator follower, following and total-like counts and IP location, default true), scrapePlayCount (boolean, play count when Douyin shows it, else null, default false), searchTermsOrHashtags (array of strings, keywords or hashtags such as "#美食"), searchSortFilter ("general" | "most_liked" | "latest", default "general"), searchPublishTimeFilter ("all" | "last_day" | "last_week" | "last_half_year", default "all"), searchDurationFilter ("all" | "within_one_minute" | "one_to_five_minutes" | "over_five_minutes", default "all"), postUrls (array of video links, full or v.douyin.com short links), profileUrls (array of profile URLs or secUids starting with MS4w), profileSortFilter ("latest" | "popular", default "latest"), profileOldestPostDate (string, absolute date or number of days back, profile inputs only), profileNewestPostDate (string, absolute date, profile inputs only), sessionId (secret string, the sessionid cookie of a logged-in douyin.com browser, needed for search and for more than about 40 videos per profile), proxyConfiguration (object, optional proxy, default {"useApifyProxy": false}). Provide at least one of postUrls, profileUrls or searchTermsOrHashtags; all three can be combined. Every saved video is one row charged as the row_result event; a deleted or private video, an empty profile or a search without a session cookie gives no row and is reported in the log. Logged out, Douyin shows about the newest 40 videos of a profile and no search results. Full input schema, every enum and default, and the complete output field list: GET https://api.apify.com/v2/acts/socialdataapi~douyin-scraper/builds/default
```

#### Douyin Scraper MCP Server: use these Actors from ChatGPT, Claude or Cursor

Point your AI assistant at Apify and it can read Douyin on its own: videos, creator profiles and search results with their engagement counts. No glue code, no scraping logic in your prompts.

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=socialdataapi/douyin-scraper"
```

#### Step by step

1. [Create a free Apify account](https://console.apify.com/sign-up).
2. Open [Douyin Scraper](https://apify.com/socialdataapi/douyin-scraper) in the Apify Store.
3. Paste Douyin post URLs or profile URLs, or type search terms and hashtags (search also needs your session cookie, see below).
4. Click **Start**.
5. Download or stream your results in JSON, CSV or Excel.

#### How to get your Douyin cookies

Only search, and more than about the newest 40 videos of a profile, need your own Douyin session cookie. Post and profile scraping work without it.

1. Log in to https://www.douyin.com in Chrome or Edge on your computer.
2. Open DevTools (F12) > Application > Cookies > https://www.douyin.com.
3. Find the cookie named `sessionid` and copy its value.
4. Paste it into the **Douyin session cookie** field (`sessionId`). The field is stored as a secret; treat the value like a password and log out of Douyin to make it stop working.

#### How to scale Douyin Scraper to bulk

To scrape Douyin videos from many creators at once, add them all: post URLs, profile URLs and search terms are all lists, so one run can take many of each and mix all three. The run reads up to 3 inputs at a time, each in its own browser, and saves every video to the dataset as soon as it is read, so a later failure never loses what was already saved. Set **Max videos per profile or search term** to cap each input. To export Douyin videos on a schedule, save the input as an Apify task and schedule it daily, or loop API calls with one creator per call.

***

### ✨ Features

Douyin Scraper fetches clean, structured videos from Douyin ⚡. A Douyin video scraper, Douyin profile scraper, Douyin hashtag scraper and Douyin search scraper in one actor (often searched for as a Chinese TikTok scraper), it's ideal for creator benchmarking, trend tracking, influencer vetting and social listening.

It extracts, per video:

- **Engagement counts** – likes, comments, shares and collects, plus play count when Douyin shows it.
- **Caption and date** – the full caption, the publish date and the exact publish time.
- **Creator** – name, handle, bio, verified badge, follower, following and total-like counts.
- **Music** – the sound's title, artist, length and whether it is an original sound.
- **Hashtags and mentions** – every hashtag and @mention in the caption.
- **Video links** – the video page, a playable video link and the cover images.

⚡ Play count stays empty (`null`) when Douyin hides it, never a made-up 0, and each video is saved the moment it is read.

***

### Use cases 💡

- **Social media analyst** — benchmark a creator's newest videos by likes and comments.
- **Brand partnerships manager** — shortlist creators by follower count and total likes.
- **Music supervisor** — spot which original sounds drive the most videos.
- **Content researcher** — map how a hashtag trend spreads across creators.
- **AI engineer** — feed captions, hashtags and counts into a RAG pipeline for a trend agent.

Building an AI agent? [Connect Douyin Scraper over MCP](#mcp-integration-for-ai-agents) and let it call the actor on its own.

***

### Why choose this actor?

- **Posts, profiles and search in one run.** A recorded run took 1 post URL, 1 profile and 1 hashtag at the same time and saved 6 videos in 17.6 seconds, reporting that the hashtag needed a session cookie.
- **Creator numbers on every video.** A recorded video came back with 315,151 likes, 4,896 collects and 3,959 shares, from a verified creator with 203,667,186 followers.
- **3 input kinds, 6 filters.** Post URLs, profile URLs or secUids, and search terms or hashtags, with profile sort and date filters and search sort, publish-time and duration filters.

***

### ⬇️ Input

![Douyin Scraper input form with example values](https://api.apify.com/v2/key-value-stores/WYkyEfqs10huyXYxr/records/s-douyin-input.webp)

Douyin Scraper takes Douyin post URLs, profile URLs or secUids, and search terms or hashtags, each as a list. No single field is required, but at least one of the three lists must have an entry.

| Parameter | Required | Type | Description | Example value |
| --- | --- | --- | --- | --- |
| `maxItemsPerUrl` | No | Integer | Maximum videos saved per profile and per search term; `0` = no limit. Default `0`. A post URL always gives one video. Logged out, Douyin shows about the newest 40 videos of a profile. | `10` |
| `scrapeAdditionalUserInfo` | No | Boolean | Add the creator's follower, following and total-like counts, IP location and more. Default `true`. | `true` |
| `scrapePlayCount` | No | Boolean | Include the play count; it is `null` when Douyin hides it. Default `false`. | `false` |
| `searchTermsOrHashtags` | No | Array | Search terms or hashtags. Needs the session cookie. | `["#美食", "anime edit"]` |
| `searchSortFilter` | No | String | Search order: `general`, `most_liked`, `latest`. Default `general`. | `"latest"` |
| `searchPublishTimeFilter` | No | String | Search publish time: `all`, `last_day`, `last_week`, `last_half_year`. Default `all`. | `"last_week"` |
| `searchDurationFilter` | No | String | Search video length: `all`, `within_one_minute`, `one_to_five_minutes`, `over_five_minutes`. Default `all`. | `"one_to_five_minutes"` |
| `postUrls` | No | Array | Video links, full `douyin.com/video/...` or `v.douyin.com` short links. | `["https://www.douyin.com/video/7703967284464815398"]` |
| `profileUrls` | No | Array | Profile URLs, or secUids starting with `MS4w`. | `["https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4"]` |
| `profileSortFilter` | No | String | Profile order: `latest` (newest first) or `popular` (most liked of the videos Douyin shows). Default `latest`. | `"popular"` |
| `profileOldestPostDate` | No | String | Profile inputs only: videos published on or after this date, or a number of days (`1` = today only, `2` = yesterday and today). | `"2026-01-01"` |
| `profileNewestPostDate` | No | String | Profile inputs only: videos published on or before this date. | `"2026-06-30"` |
| `sessionId` | No | String (secret) | The `sessionid` cookie of a logged-in douyin.com browser. Needed for search and for more than about 40 videos per profile. | `"<your sessionid>"` |
| `proxyConfiguration` | No | Object | Optional proxy. Leave it as is to let the run pick one only when needed. Default `{"useApifyProxy": false}`. | `{"useApifyProxy": false}` |

Which parameters each input kind uses:

- **Post URLs** — `postUrls`, `scrapeAdditionalUserInfo`, `scrapePlayCount`.
- **Profiles** — `profileUrls`, `maxItemsPerUrl`, `profileSortFilter`, `profileOldestPostDate`, `profileNewestPostDate`, `scrapeAdditionalUserInfo`, `scrapePlayCount`, optional `sessionId`.
- **Search** — `searchTermsOrHashtags`, `maxItemsPerUrl`, `searchSortFilter`, `searchPublishTimeFilter`, `searchDurationFilter`, `scrapePlayCount`, `sessionId`.

#### Free plan limits

Users on the Apify free plan can fetch up to 20 videos per run (all inputs together) and 200 videos per month. When the limit is reached, the run finishes successfully with a status message explaining the limit. Upgrade to any paid Apify plan to remove these limits.

#### Example input

Post URLs:

```json
{
  "postUrls": ["https://www.douyin.com/video/7703967284464815398"],
  "scrapeAdditionalUserInfo": true,
  "scrapePlayCount": false
}
```

Profile, most liked first, with a date window:

```json
{
  "profileUrls": ["https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4"],
  "maxItemsPerUrl": 10,
  "profileSortFilter": "popular",
  "profileOldestPostDate": "2026-01-01",
  "profileNewestPostDate": "2026-06-30",
  "scrapeAdditionalUserInfo": true,
  "scrapePlayCount": false,
  "proxyConfiguration": { "useApifyProxy": false }
}
```

Search, with every parameter:

```json
{
  "searchTermsOrHashtags": ["#美食", "anime edit"],
  "maxItemsPerUrl": 20,
  "searchSortFilter": "latest",
  "searchPublishTimeFilter": "last_week",
  "searchDurationFilter": "within_one_minute",
  "postUrls": [],
  "profileUrls": [],
  "profileSortFilter": "latest",
  "profileOldestPostDate": "",
  "profileNewestPostDate": "",
  "scrapeAdditionalUserInfo": true,
  "scrapePlayCount": true,
  "sessionId": "<your sessionid>",
  "proxyConfiguration": { "useApifyProxy": false }
}
```

***

### ⬆️ Output

![Douyin Scraper output fields with example values](https://api.apify.com/v2/key-value-stores/WYkyEfqs10huyXYxr/records/s-douyin-output.webp)

Every video is one typed, normalized JSON item with nested creator, music, video and statistics objects, the same schema on every run, ready to export as JSON (default), CSV or Excel. Post rows carry a slightly smaller field set than profile and search rows; fields Douyin does not show stay empty (`null` or `""`).

#### Example output

A real post row and a real profile row from a test run (2026-11-10):

```json
[
  {
    "id": "7703967284464815398",
    "text": "做好事不留名，小孩哥帮忙扶起侧翻的三轮车后，默默离开。为你点赞！@嚯嚯哈嘿",
    "createTime": 1793719674,
    "createDate": "03/11/2026",
    "url": "https://www.douyin.com/video/7703967284464815398",
    "authorMeta": {
      "secUid": "MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4",
      "name": "人民日报",
      "username": "rmrbxmt",
      "verified": true,
      "signature": "参与、沟通、记录时代。",
      "avatarThumb": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_21b4383e542b8991bcd33d33eeda7d8d.jpeg?from=327834062",
      "avatarLarge": "https://p3-pc.douyinpic.com/aweme/1080x1080/aweme-avatar/tos-cn-avt-0015_21b4383e542b8991bcd33d33eeda7d8d.jpeg?from=2956013662",
      "followingCount": 40,
      "followersCount": 203667186,
      "heartCount": 19306539108,
      "age": null,
      "ipLocation": null,
      "gender": "unknown"
    },
    "musicMeta": {
      "id": "7703967219360828170",
      "name": "@人民日报创作的原声",
      "author": "人民日报",
      "duration": 11,
      "playUrl": null
    },
    "thumb": null,
    "videoMeta": {
      "cover": "https://p3-pc-sign.douyinpic.com/image-cut-tos-priv/595236a71e4b7248549c6435475e5046~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2109668400&x-signature=7MjrQJLjCK%2FvSBZ8JH1JG%2B3Lgek%3D&from=327834062&s=PackSourceEnum_AWEME_DETAIL&se=false&sc=cover&biz_tag=pcweb_cover&l=20261110190122B1E8B42FC4E173D2DAA7",
      "originCover": "https://p9-pc-sign.douyinpic.com/tos-cn-p-0015/oEPfXE3MVHB6li4TCvFEAxDrB0A7N61QQvfBEf~tplv-dy-360p.jpeg?lk3s=138a59ce&x-expires=1795518000&x-signature=TPoPAhD2Fw%2Bv4Y%2FpaXuFOybqOIo%3D&from=327834062&s=PackSourceEnum_AWEME_DETAIL&se=false&sc=origin_cover&biz_tag=pcweb_cover&l=20261110190122B1E8B42FC4E173D2DAA7",
      "dinamicCover": "https://p9-pc-sign.douyinpic.com/obj/tos-cn-i-dy/c3ef64e5b18246b3a65a268af79b0dd3?lk3s=138a59ce&x-expires=1795518000&x-signature=3FobY9R9zxVPgnaPXDR56fUuQIk%3D&from=327834062_large&s=PackSourceEnum_AWEME_DETAIL&se=false&sc=dynamic_cover&biz_tag=pcweb_cover&l=20261110190122B1E8B42FC4E173D2DAA7",
      "height": 3840,
      "width": 2160,
      "playUrl": "https://api-play.amemv.com/aweme/v1/play/?video_id=v0200fg10000dbkvoqvog65nrpvg1h30&line=0&file_id=451aad5fa9844ce98c7708159d7097db&sign=d2d2b74a98869d2d783dabc9f96f16f0&is_play_url=1&source=PackSourceEnum_AWEME_DETAIL&biz_sign=NRPI1lC4AlkgB1YZ_o3Jx_AfESRKvePEcubBrcg7ZWuwTcZpB4tBhs1G-ueE9VaaOzLa7CA0Ou-V1V2BgVYWftYb6UfHDGbNHaUZIZuaRMUGyO7s5wbVW7et0I2xs1hA&aid=6383"
    },
    "statistics": {
      "diggCount": 315151,
      "shareCount": 3959,
      "commentCount": 86,
      "collectCount": 4896,
      "playCount": null
    },
    "mentions": [
      { "id": "70847692832", "secUid": "MS4wLjABAAAAW_ljZUO6XJTQJHAXZECgwL9bFdYo1DnZxCp2f1lb9Q8", "name": "" }
    ],
    "hashtags": [],
    "inputUrl": "https://www.douyin.com/video/7703967284464815398",
    "scrapeType": "post"
  },
  {
    "id": "7703967284464815398",
    "text": "做好事不留名，小孩哥帮忙扶起侧翻的三轮车后，默默离开。为你点赞！@嚯嚯哈嘿",
    "createTime": 1793719674,
    "createDate": "03/11/2026",
    "thumb": "https://p3-pc-sign.douyinpic.com/obj/tos-cn-i-dy/c3ef64e5b18246b3a65a268af79b0dd3?lk3s=138a59ce&x-expires=2109668400&x-signature=j6u8aVjcgM0r0rUEPMhD4SNnjQc%3D&from=327834062&s=PackSourceEnum_PUBLISH&se=false&sc=cover&biz_tag=pcweb_cover&l=2026111019012791F6058A6FC677B8EE55",
    "url": "https://www.douyin.com/video/7703967284464815398",
    "authorMeta": {
      "id": "104255897823",
      "secUid": "MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4",
      "name": "人民日报",
      "username": "rmrbxmt",
      "verified": true,
      "signature": "参与、沟通、记录时代。",
      "avatarThumb": "https://p3-pc.douyinpic.com/aweme/100x100/aweme-avatar/tos-cn-avt-0015_21b4383e542b8991bcd33d33eeda7d8d.jpeg?from=327834062",
      "avatarLarge": "https://p3-pc.douyinpic.com/aweme/1080x1080/aweme-avatar/tos-cn-avt-0015_21b4383e542b8991bcd33d33eeda7d8d.jpeg?from=2956013662",
      "followingCount": 40,
      "followersCount": 203667186,
      "heartCount": 19306539108,
      "age": null,
      "ipLocation": null,
      "gender": "unknown"
    },
    "musicMeta": {
      "id": "7703967219360828170",
      "name": "@人民日报创作的原声",
      "author": "人民日报",
      "album": "",
      "isOriginal": true,
      "duration": 11,
      "playUrl": null
    },
    "videoMeta": {
      "cover": "https://p3-pc-sign.douyinpic.com/obj/tos-cn-i-dy/c3ef64e5b18246b3a65a268af79b0dd3?lk3s=138a59ce&x-expires=2109668400&x-signature=j6u8aVjcgM0r0rUEPMhD4SNnjQc%3D&from=327834062&s=PackSourceEnum_PUBLISH&se=false&sc=cover&biz_tag=pcweb_cover&l=2026111019012791F6058A6FC677B8EE55",
      "originCover": "https://p9-pc-sign.douyinpic.com/tos-cn-p-0015/oEPfXE3MVHB6li4TCvFEAxDrB0A7N61QQvfBEf~tplv-dy-360p.jpeg?lk3s=138a59ce&x-expires=1795518000&x-signature=TPoPAhD2Fw%2Bv4Y%2FpaXuFOybqOIo%3D&from=327834062&s=PackSourceEnum_PUBLISH&se=false&sc=origin_cover&biz_tag=pcweb_cover&l=2026111019012791F6058A6FC677B8EE55",
      "dinamicCover": "https://p9-pc-sign.douyinpic.com/obj/tos-cn-i-dy/c3ef64e5b18246b3a65a268af79b0dd3?lk3s=138a59ce&x-expires=1795518000&x-signature=3FobY9R9zxVPgnaPXDR56fUuQIk%3D&from=327834062_large&s=PackSourceEnum_PUBLISH&se=false&sc=dynamic_cover&biz_tag=pcweb_cover&l=2026111019012791F6058A6FC677B8EE55",
      "height": 1024,
      "width": 576,
      "duration": 11350,
      "playUrl": "https://api-play.amemv.com/aweme/v1/play/?video_id=v0200fg10000dbkvoqvog65nrpvg1h30&line=0&file_id=451aad5fa9844ce98c7708159d7097db&sign=d2d2b74a98869d2d783dabc9f96f16f0&is_play_url=1&source=PackSourceEnum_PUBLISH&biz_sign=NRPI1lC4AlkgB1YZ_o3Jx_AfESRKvePEcubBrcg7ZWuwTcZpB4tBhs1G-ueE9VaaOzLa7CA0Ou-V1V2BgVYWftYb6UfNDGbNHaUZIZuaRMUGyO7s5wbVW7et0I2xs1hA&aid=6383"
    },
    "statistics": {
      "diggCount": 315151,
      "shareCount": 3959,
      "commentCount": 86,
      "collectCount": 4896,
      "downloadCount": null,
      "playCount": null
    },
    "mentions": [
      { "id": "70847692832", "secUid": "MS4wLjABAAAAW_ljZUO6XJTQJHAXZECgwL9bFdYo1DnZxCp2f1lb9Q8", "name": "" }
    ],
    "hashtags": [],
    "inputUrl": "https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4",
    "scrapeType": "profile"
  }
]
```

Search rows have the same shape as profile rows, with `scrapeType` set to `search` and the search term in `inputUrl`.

***

### How does it work?

Douyin Scraper opens Douyin's own pages in a real browser, which handles page rendering and Douyin's visitor checks automatically, and reads the same video data those pages load for a visitor. Each input is tried first without a proxy; if Douyin does not answer, the run retries through Apify datacenter and then residential proxies and stays on the working network for the rest of the run. A deleted or private video, an empty profile or a search without a session cookie is reported in the log instead of being retried, because a new connection cannot change that answer. Without a session cookie it returns only publicly visible data — what any visitor sees without logging in. The output schema is normalized, so your field names stay the same even when Douyin changes its page design.

***

### How do you integrate Douyin Scraper into your stack?

It works with what you already use: the REST API from any language, MCP for AI agents, and no-code tools.

#### Using Douyin Scraper with the Apify API

```python
import requests

resp = requests.post(
    "https://api.apify.com/v2/acts/socialdataapi~douyin-scraper/run-sync-get-dataset-items",
    params={"token": "APIFY_TOKEN"},
    json={"profileUrls": ["https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4"], "maxItemsPerUrl": 10},
)
for video in resp.json():
    print(video["text"], video["statistics"]["diggCount"])
```

*Works in Go, Ruby, Node.js, cURL — any language that can make an HTTP request.*

#### MCP integration for AI agents

Add the Apify MCP server with this Actor preloaded, and your agent can pull Douyin videos and creator numbers in the middle of a conversation:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=socialdataapi/douyin-scraper"
```

This registers Douyin Scraper as a tool your agent can call directly. It works in Claude Code, Cursor and Windsurf, and in any MCP client that supports HTTP servers.

#### No-code tools (n8n, Make, LangChain)

- **n8n** — use the Apify node's "Run an Actor" operation with `socialdataapi/douyin-scraper`, or an HTTP Request node pointed at the run-sync-get-dataset-items endpoint with your token.
- **Make** — add the Apify app's "Run an Actor" module, then "Get Dataset Items" to pass every video to the next module.
- **LangChain** — install `langchain-apify` and use `ApifyActorsTool("socialdataapi/douyin-scraper")` as a tool in your agent.

***

### Is it legal to scrape Douyin data?

Scraping publicly available Douyin videos is generally lawful, because the data is visible to anyone without logging in. Douyin Scraper returns only publicly available data from post and profile inputs; search uses your own session and returns what your account sees. Creator names, handles, avatars and IP locations can identify a real person; scraping public data is generally permissible, but storing and using it must comply with GDPR, China's PIPL and other local data-protection law. Not legal advice. Consult legal counsel if your use case involves bulk storage of personal data.

***

### Frequently asked questions

#### What fields does Douyin Scraper return?

Each video comes with its caption, publish date, like, comment, share and collect counts, and the creator's name, handle and follower count, plus music, hashtags, mentions and video links. See [the data fields section](#what-data-can-i-extract-with-douyin-scraper) for the full list.

#### Does Douyin Scraper require a Douyin account or login?

Not for post URLs and profiles. Search needs your own Douyin `sessionid` cookie, because Douyin shows search results only to logged-in visitors; the same cookie also unlocks more than about the newest 40 videos of a profile. The cookie field is stored as a secret and never appears in the log.

#### How fast does Douyin Scraper run?

A recorded run with 1 post URL, 1 profile and 1 hashtag saved 6 videos in 17.6 seconds. Every run reads live data, not a cache.

#### What happens if a video is private or doesn't exist?

A deleted or private video, an empty profile or a search without a session cookie gives no row; the log names the input and the reason, and the run moves on. In code, compare the input list with the `inputUrl` values in the dataset to see which inputs gave nothing.

#### Can I scrape multiple Douyin videos, profiles or search terms at once?

Yes. Post URLs, profile URLs and search terms are all lists and can be combined in one run; up to 3 inputs are read at the same time.

#### Does Douyin Scraper work with Claude, ChatGPT, and other AI agent tools?

Yes — Douyin Scraper is available as an MCP tool. Register it in Claude Code, Cursor or Windsurf with `claude mcp add --transport http apify "https://mcp.apify.com?tools=socialdataapi/douyin-scraper"`. Any agent that can call an HTTP endpoint can use the REST API directly.

#### Does Douyin Scraper return data in a format LLMs can use directly?

Yes. Every video is typed, normalized JSON with consistent field names, with no HTML parsing and no selectors. Pass it straight to an LLM, index it into a vector store, or feed it to an agent tool with no transformation step.

#### What happens when Douyin changes its layout or updates its anti-bot system?

The actor is maintained. When Douyin changes, the actor is updated, and your calls keep returning the same JSON schema with no changes on your end.

#### Can I use Douyin Scraper without managing proxies or browser infrastructure?

Yes. The browser and the switch to Apify datacenter and residential proxies run on the actor's side. You send one request and get structured JSON back, with no proxy accounts, no headless browser setup and no maintenance.

#### Which Douyin video fields work best for AI training data and RAG indexing?

For RAG, index the caption, hashtags and creator name and bio. For training data, use the like, comment, share and collect counts, the creator's follower count and total likes, and the video length. All fields are typed values — strings, integers, booleans and arrays — with no normalization needed.

***

### Related scrapers

| Scraper | What it extracts |
| --- | --- |
| [Douyin Email Scraper](https://apify.com/socialdataapi/douyin-email-scraper) | Contact emails linked to Douyin creators. |
| [Douyin Phone Number Scraper](https://apify.com/socialdataapi/douyin-phone-number-scraper) | Contact phone numbers linked to Douyin creators. |
| [TikTok Video Scraper](https://apify.com/socialdataapi/tiktok-video-scraper) | TikTok videos with their engagement counts. |
| [TikTok Profile Scraper](https://apify.com/socialdataapi/tiktok-profile-scraper) | TikTok creator profiles and their numbers. |
| [TikTok Comments Scraper](https://apify.com/socialdataapi/tiktok-comments-scraper) | Comments on TikTok videos. |

***

### Your feedback

Found a bug or missing a field? Let us know on the Actor's Issues tab in Apify Console. Every report is read, and fixes ship as new versions of the actor.

# Changelog

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

# Actor input Schema

## `maxItemsPerUrl` (type: `integer`):

Maximum number of videos saved per profile and per search term (0 = no limit). A post URL always gives one video. Logged out, Douyin shows about the newest 40 videos of a profile. Free plan: up to 20 videos per run (all inputs together) and 200 per month; paid plans have no limit.

## `scrapeAdditionalUserInfo` (type: `boolean`):

Whether to scrape additional user profile information such as follower count, following count, total likes, IP location and more.

## `scrapePlayCount` (type: `boolean`):

Include the play count. Douyin usually hides it; then the field is null.

## `searchTermsOrHashtags` (type: `array`):

Search terms or hashtags, e.g. `#美食` or `anime edit`. Douyin shows search results only to logged-in visitors: add your Douyin session cookie below.

## `searchSortFilter` (type: `string`):

How search results are sorted: general, most liked or newest (needs the session cookie).

## `searchPublishTimeFilter` (type: `string`):

Filter search results by publish time (needs the session cookie).

## `searchDurationFilter` (type: `string`):

Filter search results by video duration (needs the session cookie).

## `postUrls` (type: `array`):

Video links, e.g. https://www.douyin.com/video/7703967284464815398.

## `profileUrls` (type: `array`):

Should be a list of profile URLs you want to scrape. You can also provide UserSecIDs (starting with `MS4w...`) instead of full URLs.

## `profileSortFilter` (type: `string`):

Latest = newest first. Popular = the most liked of the videos Douyin shows.

## `profileOldestPostDate` (type: `string`):

Optional filter. Only valid for profile scraping. Only videos uploaded after or on this date will be scraped. Alternatively, specify how old the scraped videos should be in days. Putting 1 will get you only today's posts, 2 - yesterday's and today's, and so on.

## `profileNewestPostDate` (type: `string`):

Optional filter. Only valid for profile scraping. Only videos uploaded on or before this date will be scraped.

## `sessionId` (type: `string`):

The value of the 'sessionid' cookie of a logged-in douyin.com browser (DevTools > Application > Cookies > https://www.douyin.com). Treat it like a password. Post and profile scraping work without it.

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

Optional proxy. Leave empty to let the run pick one only when needed.

## Actor input object example

```json
{
  "maxItemsPerUrl": 10,
  "scrapeAdditionalUserInfo": true,
  "scrapePlayCount": false,
  "searchTermsOrHashtags": [
    "#美食",
    "anime edit"
  ],
  "searchSortFilter": "general",
  "searchPublishTimeFilter": "all",
  "searchDurationFilter": "all",
  "postUrls": [
    "https://www.douyin.com/video/7703967284464815398"
  ],
  "profileUrls": [
    "https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4"
  ],
  "profileSortFilter": "latest",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped items in the Actor's default dataset.

# 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 = {
    "maxItemsPerUrl": 10,
    "profileUrls": [
        "https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("socialdataapi/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 = {
    "maxItemsPerUrl": 10,
    "profileUrls": ["https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("socialdataapi/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 '{
  "maxItemsPerUrl": 10,
  "profileUrls": [
    "https://www.douyin.com/user/MS4wLjABAAAA8U_l6rBzmy7bcy6xOJel4v0RzoR_wfAubGPeJimN__4"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call socialdataapi/douyin-scraper --silent --output-dataset

```

## MCP server setup

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