# Douyin Account Analytics Scraper (`toolzerhub/douyin-account-analytics-scraper`) Actor

Get analytics for any public Douyin account: the hot-account board and account search, a follower-growth trend series, weekly performance against peer averages and percentiles, and audience demographics by region, gender, age, and device -- normally visible only to a logged-in Douyin creator.

- **URL**: https://apify.com/toolzerhub/douyin-account-analytics-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 $10.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/actors/running/actors-in-store.md#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 Account Analytics Scraper

Get analytics for any public Douyin account: the hot-account board and account search, a follower-growth trend, weekly performance against peer averages and percentiles, and audience demographics by region, gender, age, and device — normally visible only to the account's own logged-in creator. Pick a mode with `scraperType`.

### Modes

| `scraperType` | Returns | Needs |
|---|---|---|
| `accountsBoard` (default) | Accounts trending by follower and like growth | — |
| `accountSearch` | Search the hot-account board by name or handle | `keyword` |
| `accountTrend` | One account's follower-growth trend | `sec_user_id` |
| `accountAnalysis` | One account's weekly posts vs. its peer group, average and percentile | `sec_user_id` |
| `accountAudience` | One account's follower demographics — region, gender, age, device | `sec_user_id` |
| `accountAudienceAccounts` | The other accounts one account's audience also follows | `sec_user_id` |

### Input

| Field | Use it for |
|---|---|
| **`sec_user_id`** | A profile URL or sec\_user\_id. Required for every mode except `accountsBoard` and `accountSearch`. |
| **`keyword`** | Required for `accountSearch`. |
| **`date_window`** | `accountsBoard` only. Hours: `1` past hour, `24` past day (default), `168` past week, `720` past month. |
| **`option`** | `accountTrend` (default `2`) and `accountAudience` (default `1`) only. Integer `1`–`9` — `0` and `10` are both rejected. |
| **`addonProfileDetails`** | Every mode except `accountTrend`. Fetches full profile detail for each account — one extra request and one extra charge per row. |
| **`maxItems`** | Caps `accountsBoard` and `accountSearch`. Default `100`. Set `0` for no limit. |

```json
{
  "scraperType": "accountTrend",
  "sec_user_id": "MS4wLjABAAAAY3J1P0y5w7hzttTyvZiLjhMu3iOzF-1yFi6yNtXVHzkmVGFIx7T8s-nRmGNusfh1"
}
```

### `accountTrend` is one row, not one row per data point

A follower-trend request returns the account's whole series in a single upstream call — around 90 points on a weekly window for a large account. This Actor keeps that as **one row holding a `trends` array**, rather than exploding it into one row per point. That's deliberate: a row means the same amount of upstream work on every mode in this Actor, not ~90 times more on this one. If you were expecting close to 90 rows out of a trend run, expect one row instead, and read the points out of `trends` yourself.

### Output

| Field | Mode | Contents |
|---|---|---|
| **`user_id`**, **`sec_uid`**, **`nick_name`**, **`avatar_url`**, **`fans_cnt`**, **`like_cnt`**, **`publish_cnt`**, **`new_like_cnt`**, **`new_fans_cnt`**, **`fans_trends`**, **`fans_incr_rate`**, **`second_tag_name`**, **`group_name`**, **`profile_detail`** | `accountsBoard`, `accountAudienceAccounts` | Each account on the board |
| Same, plus **`source_keyword`** | `accountSearch` | Each matching account |
| **`trends`**, **`avg`**, **`option`**, **`sec_uid`**, **`source_sec_user_id`** | `accountTrend` | The whole follower-growth series, one row |
| **`avg_aweme_count`**, **`avg_comment_count`**, **`avg_share_count`**, **`avg_follower_count`**, **`avg_like_count`**, **`percentile_aweme_count`**, **`percentile_comment_count`**, **`percentile_share_count`**, **`percentile_follower_count`**, **`percentile_like_count`**, **`profile_detail`** | `accountAnalysis` | Averages and peer percentiles for one week |
| **`portrait`**, **`portrait_tgi`**, **`option`**, **`profile_detail`** | `accountAudience` | Follower demographic breakdown |

```json
{
  "trends": [{ "datetime": "20260805", "value": 4812093 }, { "datetime": "20260806", "value": 4815441 }],
  "avg": 4813200,
  "option": 2,
  "source_sec_user_id": "MS4wLjABAAAAY3J1P0y5w7hzttTyvZiLjhMu3iOzF-1yFi6yNtXVHzkmVGFIx7T8s-nRmGNusfh1"
}
```

### Questions

**Why did `accountTrend` only return one row?**
By design — see the note above. The row's `trends` field holds the whole series.

**What audience breakdowns does `accountAudience` cover?**
Region, gender, age, and device, all in `portrait` and `portrait_tgi`. Two further sub-breakdowns Douyin exposes for this board — recent audience searches and audience topics — came back empty on every account tested and are not offered here; `accountAudience` and `accountAudienceAccounts` are the two breakdowns that reliably return data.

**Why can't I set `option` to any number I like?**
The source only accepts integers `1`–`9`; `0` and `10` are both rejected outright. Each mode that uses it keeps its own verified default rather than one shared default, because the meaningful metric differs per mode.

**Does `accountSearch` page automatically?**
Yes, on the source's own cursor — raise `maxItems` and the Actor keeps requesting further pages until it's reached or the source runs out.

### Related Actors

| Actor | Purpose |
|---|---|
| [Douyin Profile Scraper](https://apify.com/toolzerhub/douyin-profile-scraper) | Basic profile fields — bio, follower count, verification — without the analytics |
| [Douyin Video Analytics Scraper](https://apify.com/toolzerhub/douyin-video-analytics-scraper) | The same kind of analytics, scoped to one video instead of a whole account |
| [Douyin Trending Scraper](https://apify.com/toolzerhub/douyin-billboard-scraper) | The video, topic, and search boards this account board sits alongside |

### Support

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

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

# Actor input Schema

## `scraperType` (type: `string`):

Choose the dataset for this run.

## `date_window` (type: `string`):

How far back the board is measured.

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

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

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

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

## `addonProfileDetails` (type: `boolean`):

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

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

Paste the profile's Douyin page link (douyin.com/user/...), or just the sec\_user\_id part of it.

## `option` (type: `integer`):

Which metric the breakdown is measured by, numbered 1-9. Each board sets its own sensible default, so this is only for picking a different one.

## Actor input object example

```json
{
  "scraperType": "accountsBoard",
  "date_window": "24",
  "keyword": "猫咪",
  "maxItems": 20,
  "addonProfileDetails": false,
  "sec_user_id": "https://www.douyin.com/user/MS4wLjABAAAAY3J1P0y5w7hzttTyvZiLjhMu3iOzF-1yFi6yNtXVHzkmVGFIx7T8s-nRmGNusfh1"
}
```

# Actor output Schema

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

Every record collected during this run

# API

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

## JavaScript example

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

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

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

// Run the Actor and wait for it to finish
const run = await client.actor("toolzerhub/douyin-account-analytics-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "keyword": "猫咪",
    "maxItems": 20,
    "sec_user_id": "https://www.douyin.com/user/MS4wLjABAAAAY3J1P0y5w7hzttTyvZiLjhMu3iOzF-1yFi6yNtXVHzkmVGFIx7T8s-nRmGNusfh1",
}

# Run the Actor and wait for it to finish
run = client.actor("toolzerhub/douyin-account-analytics-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "keyword": "猫咪",
  "maxItems": 20,
  "sec_user_id": "https://www.douyin.com/user/MS4wLjABAAAAY3J1P0y5w7hzttTyvZiLjhMu3iOzF-1yFi6yNtXVHzkmVGFIx7T8s-nRmGNusfh1"
}' |
apify call toolzerhub/douyin-account-analytics-scraper --silent --output-dataset

```

## MCP server setup

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