# Douyin Profile Videos Scraper (`toolzerhub/douyin-profile-videos-scraper`) Actor

Collect every public video from a Douyin profile by sec\_user\_id, newest or most-liked first. Each row returns the caption, publish date, duration, play/like/comment/share counts, sound, and author, plus full video detail on request. Export Douyin video data, run via API, or schedule pulls.

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

## Pricing

from $2.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Douyin Profile Videos Scraper

Collect every public video a Douyin profile has posted, newest or most-liked first, from its `sec_user_id`. Each row carries the caption, publish date, duration, engagement stats, sound, and author — with full per-video detail available as an add-on.

### Input

| Field | Type | Default | What it does |
|---|---|---|---|
| `sec_user_id` | string | — | **Required.** A Douyin profile URL, or the `sec_user_id` it contains. |
| `maxItems` | integer | `100` | Rows to save. `0` collects until the profile is exhausted. |
| `sort_recent_first` | enum | `0` (Newest first) | `0` newest first, `1` most popular first. |
| `addonVideoDetails` | boolean | `false` | Fetch full video detail for every row found. |

```json
{
  "sec_user_id": "https://www.douyin.com/user/MS4wLjABAAAAY3J1P0y5w7hzttTyvZiLjhMu3iOzF-1yFi6yNtXVHzkmVGFIx7T8s-nRmGNusfh1",
  "sort_recent_first": "0",
  "maxItems": 50
}
```

### Output

| Field | Contents |
|---|---|
| `aweme_id` | Video ID |
| `desc` | Caption text |
| `create_time` | Publish timestamp (Unix) |
| `duration` | Video length, milliseconds |
| `statistics` | `digg_count`, `comment_count`, `share_count`, `collect_count` |
| `author` | The account that published this video |
| `music` | The sound attached to it |
| `video` | Cover images and play addresses |
| `share_url` | Public share link |
| `source_sec_user_id` | The profile this row was collected from |
| `video_detail` | Full video detail — only present when `addonVideoDetails` is on |

### Questions

**What does `addonVideoDetails` add that the base row doesn't already have?**
The base row already covers caption, stats, sound, and author. `video_detail` adds the full detail payload for that video — hashtags, image lists, and everything else `videos/detail` reports. It costs one extra request per video, and that request is charged per enriched row, so a 500-video profile with the add-on on is 500 extra requests billed. Leave it off unless you actually need per-video hashtag or image data beyond what the list already gives you.

**How does pagination behave — will I ever get fewer videos than `maxItems`?**
Yes, once the profile runs out of videos. The Actor pages the profile's post list in batches of 20 until either `maxItems` is reached or Douyin reports no more pages — an account with 30 public videos and `maxItems: 100` returns 30 rows, not 100.

**Does `sort_recent_first` change which videos I get, or just their order?**
Just the order. It's the same underlying video list either way — set it to `1` when you want the profile's best-performing content first instead of paging through everything to find it.

### Other Douyin Actors

| Actor | Use when |
|---|---|
| [Douyin Profile Scraper](https://apify.com/toolzerhub/douyin-profile-scraper) | You only need the account's bio, not its videos |
| [Douyin Video Scraper](https://apify.com/toolzerhub/douyin-video-scraper) | You already have a specific video ID and want its full detail |
| [Douyin Video Downloader](https://apify.com/toolzerhub/douyin-video-downloader) | You want a playable URL for videos this Actor finds |
| [Douyin Comments Scraper](https://apify.com/toolzerhub/douyin-comments-scraper) | You want the comment section on one of these videos |

### Support

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

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

# Actor input Schema

## `sec_user_id` (type: `string`):

A Douyin profile URL, or the sec\_user\_id it contains.

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

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

## `sort_recent_first` (type: `string`):

Order for a profile's own videos.

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

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

## Actor input object example

```json
{
  "sec_user_id": "https://www.douyin.com/user/MS4wLjABAAAAY3J1P0y5w7hzttTyvZiLjhMu3iOzF-1yFi6yNtXVHzkmVGFIx7T8s-nRmGNusfh1",
  "maxItems": 20,
  "sort_recent_first": "0",
  "addonVideoDetails": false
}
```

# Actor output Schema

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

Every record collected during this run

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "sec_user_id": "https://www.douyin.com/user/MS4wLjABAAAAY3J1P0y5w7hzttTyvZiLjhMu3iOzF-1yFi6yNtXVHzkmVGFIx7T8s-nRmGNusfh1",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("toolzerhub/douyin-profile-videos-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 = {
    "sec_user_id": "https://www.douyin.com/user/MS4wLjABAAAAY3J1P0y5w7hzttTyvZiLjhMu3iOzF-1yFi6yNtXVHzkmVGFIx7T8s-nRmGNusfh1",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("toolzerhub/douyin-profile-videos-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 '{
  "sec_user_id": "https://www.douyin.com/user/MS4wLjABAAAAY3J1P0y5w7hzttTyvZiLjhMu3iOzF-1yFi6yNtXVHzkmVGFIx7T8s-nRmGNusfh1",
  "maxItems": 20
}' |
apify call toolzerhub/douyin-profile-videos-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,toolzerhub/douyin-profile-videos-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/iNME7e7ML2LBevRU6/builds/u0wHS4oeEIwVkhX9q/openapi.json
