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

Extract public Douyin profiles by URL, sec\_user\_id, uid, or handle. Get nickname, bio, follower and following counts, video count, verification, IP location, gender, and city for one Douyin account or many at once. Export the data, run via API, or schedule recurring pulls.

- **URL**: https://apify.com/toolzerhub/douyin-profile-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.40 / 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 Scraper

Fetch a public Douyin profile — nickname, bio, follower and following counts, video count, verification, IP region, gender, and city — from a profile URL, `sec_user_id`, numeric `uid`, or handle (抖音号). Hand it a comma-separated list of `sec_user_id` values instead and get one row back per account.

### Input

| Field | Type | Default | What it does |
|---|---|---|---|
| `sec_user_id` | string | — | A Douyin profile URL, or the `sec_user_id` it contains. |
| `sec_user_ids` | string | — | Several `sec_user_id` values, comma-separated. |
| `uid` | string | — | A profile's numeric `uid`. |
| `username` | string | — | A profile's handle (抖音号), without the leading @. |
| `maxItems` | integer | `100` | Caps how many IDs from `sec_user_ids` get resolved. `0` resolves the whole list. |

Provide exactly one identifier. The run checks them in this order — `sec_user_ids`, then `sec_user_id`, then `uid`, then `username` — and uses whichever it finds first.

```json
{ "sec_user_id": "https://www.douyin.com/user/MS4wLjABAAAAY3J1P0y5w7hzttTyvZiLjhMu3iOzF-1yFi6yNtXVHzkmVGFIx7T8s-nRmGNusfh1" }
```

### Output

| Field | Contents |
|---|---|
| `nickname`, `unique_id` | Display name and handle |
| `sec_uid`, `uid`, `short_id` | The three ID forms Douyin uses for this account |
| `signature` | Bio text |
| `follower_count`, `following_count`, `aweme_count` | Followers, following, videos published |
| `total_favorited`, `favoriting_count` | Likes received across all videos, and likes given |
| `custom_verify`, `enterprise_verify_reason` | Verification label, when verified |
| `ip_location`, `gender`, `city`, `country` | Location and profile fields, when set |
| `live_status` | Whether the account is broadcasting right now |
| `avatar_larger` | Profile picture URLs |
| `source_sec_user_id` | The ID this row was collected for |

Douyin exposes profile lookups through three genuinely different endpoints depending on which identifier you hand it, and this Actor normalizes all three onto the field list above. A lookup by `sec_user_id` is the richest — it's Douyin's own canonical profile shape. Lookups by `uid` or `username` go through thinner endpoints: `unique_id`, `aweme_count`, `total_favorited`, and `custom_verify` come back empty on the `uid` path, and `uid` itself comes back empty on the `username` path. If a field you need is missing, re-run with `sec_user_id` instead.

### Questions

**Why does looking up 5 IDs in `sec_user_ids` cost 5 requests instead of one?**
Douyin's batch profile endpoint rejects every call it's sent — verified live at 1, 2, and 3 IDs — so this Actor serves a comma-separated list as one `profiles/info` call per ID instead. Same upstream cost either way, just no single-call discount to expect.

**What happens if one ID in `sec_user_ids` is invalid?**
That ID is skipped and logged; the rest of the list still runs. One bad ID doesn't fail the whole batch.

**Why are some fields blank when I look up by `uid` or handle instead of `sec_user_id`?**
`uid` and `username` resolve through different, thinner Douyin endpoints than the canonical profile lookup. `unique_id`, `aweme_count`, `total_favorited`, and `custom_verify` are only populated on the `sec_user_id` path; the `uid` path also nests follower/following counts differently upstream, which this Actor already unpacks onto `follower_count` and `following_count` for you.

### Other Douyin Actors

| Actor | Use when |
|---|---|
| [Douyin Profile Videos Scraper](https://apify.com/toolzerhub/douyin-profile-videos-scraper) | You want this account's videos, not just its bio |
| [Douyin User Search Scraper](https://apify.com/toolzerhub/douyin-user-search-scraper) | You have a keyword, not yet a `sec_user_id` |
| [Douyin Account Analytics Scraper](https://apify.com/toolzerhub/douyin-account-analytics-scraper) | You want follower-growth trends and audience demographics for this account |

### 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.

## `sec_user_ids` (type: `string`):

Several sec\_user\_id values, separated by commas.

## `uid` (type: `string`):

A profile's numeric uid, as shown in another Actor's output.

## `username` (type: `string`):

A profile's Douyin handle (抖音号), without the leading @.

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

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

## Actor input object example

```json
{
  "sec_user_id": "https://www.douyin.com/user/MS4wLjABAAAAY3J1P0y5w7hzttTyvZiLjhMu3iOzF-1yFi6yNtXVHzkmVGFIx7T8s-nRmGNusfh1",
  "uid": "2557909361237356",
  "username": "23065405578",
  "maxItems": 20
}
```

# 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",
    "sec_user_ids": "",
    "uid": "2557909361237356",
    "username": "23065405578",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("toolzerhub/douyin-profile-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",
    "sec_user_ids": "",
    "uid": "2557909361237356",
    "username": "23065405578",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("toolzerhub/douyin-profile-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",
  "sec_user_ids": "",
  "uid": "2557909361237356",
  "username": "23065405578",
  "maxItems": 20
}' |
apify call toolzerhub/douyin-profile-scraper --silent --output-dataset

```

## MCP server setup

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