# Douyin Trend Scraper (`happy_b/douyin-trend-scraper`) Actor

Track Douyin hot search rankings, rising topics, and keyword interest over time. Export structured trend data by date and Chinese region for content planning, market research, campaign timing, and competitive intelligence.

- **URL**: https://apify.com/happy\_b/douyin-trend-scraper.md
- **Developed by:** [Happy B](https://apify.com/happy_b) (community)
- **Categories:** Social media, News
- **Stats:** 2 total users, 1 monthly users, 66.7% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.99 / 1,000 current topics

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

### What is Douyin Trend Scraper?

Douyin Trend Scraper is a **Douyin (抖音 / Chinese TikTok) trends and hot-search intelligence Actor** with two focused modes:

- **Current trends** exports the live hot-topic and rising-topic ranking.
- **Keyword trend analysis** compares interest over time for up to five terms, nationwide or for selected Chinese regions.

Use it for China-market research, social listening, content planning, editorial monitoring, and scheduled trend datasets. No Douyin login, cookie, browser, or proxy configuration is required from you.

### Why use this Douyin trend scraper?

- **Choose the product you need.** Export a current ranking snapshot or buy deeper keyword history only when you need it.
- **Compare up to five keywords.** Analyze daily interest nationwide or across selected Chinese regions in one request.
- **Get consistent structured output.** Current and keyword rows share one typed schema with documented mode-specific fields.
- **Keep measurements machine-ready.** Trend indexes, ranks, changes, and daily values are numeric—not abbreviated display text.
- **Control spend.** Every visible row is priced transparently, and the Actor respects the run's maximum charge.
- **Automate recurring research.** Save a task, schedule snapshots, trigger webhooks, and export JSON, CSV, Excel, XML, HTML, or JSONL.

### How to get Douyin trends

#### Current hot and rising topics

```json
{
  "mode": "current",
  "trendType": "all",
  "maxResults": 50
}
```

Choose `hot`, `rising`, or `all`. Each row contains rank and topic, with the reported topic index and rank movement when available.

#### Compare keyword popularity

```json
{
  "mode": "keyword",
  "keywords": ["新能源汽车", "人工智能"],
  "regions": ["北京", "上海"],
  "startDate": "2026-07-01",
  "endDate": "2026-07-31"
}
```

Each returned keyword row includes a daily `interestOverTime` series. If dates are omitted, the Actor uses the latest 30 UTC calendar days. Leave `regions` empty for nationwide data.

### What data can I extract?

#### Current trend fields

| Field | Description |
|---|---|
| `sourceMode` | `current` |
| `trendType` | Requested hot/rising selection |
| `rank` | One-based position in the returned ranking |
| `topic` | Trend text |
| `hotIndex` | Topic index reported by Douyin |
| `rankChange` | Reported ranking movement |
| `scrapeTimestamp` | UTC collection time |

#### Keyword analysis fields

| Field | Description |
|---|---|
| `sourceMode` | `keyword` |
| `keyword` | Analyzed term |
| `interestOverTime` | Array of `{"date": "YYYY-MM-DD", "value": number}` points |
| `regions` | Requested regional filters; empty means nationwide |
| `startDate`, `endDate` | Inclusive analysis window |
| `scrapeTimestamp` | UTC collection time |

Fields unavailable for a particular topic are omitted. Video counts, view counts, topic IDs, covers, and event timestamps are not part of this product's published output.

#### Current trend output example

```json
{
  "sourceMode": "current",
  "trendType": "hot",
  "rank": 1,
  "topic": "示例热点",
  "hotIndex": 9823412,
  "rankChange": 3,
  "scrapeTimestamp": "2026-08-26T12:00:00.000Z"
}
```

#### Keyword output example

```json
{
  "sourceMode": "keyword",
  "keyword": "新能源汽车",
  "interestOverTime": [
    { "date": "2026-07-30", "value": 73 },
    { "date": "2026-07-31", "value": 81 }
  ],
  "regions": ["北京", "上海"],
  "startDate": "2026-07-01",
  "endDate": "2026-07-31",
  "scrapeTimestamp": "2026-08-26T12:00:00.000Z"
}
```

Both examples show the published output shape and are not presented as captured live rows.

### Input reference

| Parameter | Used in | Default | Limits | Description |
|---|---|---:|---:|---|
| `mode` | both | `current` | — | Current ranking or keyword analysis |
| `trendType` | current | `all` | — | `all`, `hot`, or `rising` |
| `maxResults` | current | `50` | 1–200 | Maximum current-topic rows |
| `keywords` | keyword | required | 1–5 | Terms to compare |
| `startDate` | keyword | latest 30 days | YYYY-MM-DD | First analysis date |
| `endDate` | keyword | current UTC date | YYYY-MM-DD | Last analysis date |
| `regions` | keyword | nationwide | 0–20 | Chinese province or city names |

Impossible dates and reversed date ranges are rejected before billable work begins.

### Reliable results and billing

The selected date window remains consistent throughout a run. Interrupted runs can continue without duplicating rows already delivered, and charges track visible results. If a result cannot be validated, the run reports a clear sanitized error instead of returning questionable data.

### How much does Douyin trend data cost?

You pay for each visible result. Current topics and keyword analyses have separate total prices, shown below.

#### Current trend result

| Apify tier | Per topic | Per 1,000 topics |
|---|---:|---:|
| Free | $0.00899 | $8.99 |
| Bronze | $0.00799 | $7.99 |
| Silver | $0.00749 | $7.49 |
| Gold | $0.00699 | $6.99 |

#### Keyword trend result

| Apify tier | Per keyword | Per 1,000 keywords |
|---|---:|---:|
| Free | $0.01099 | $10.99 |
| Bronze | $0.00999 | $9.99 |
| Silver | $0.00899 | $8.99 |
| Gold | $0.00799 | $7.99 |

An additional $0.001 run-start charge applies.

Platinum and Diamond users receive the listed Gold price.

| Example on the Free tier | Estimated cost |
|---|---:|
| 50 current topics | $0.451 |
| 5 keyword comparisons | $0.056 |
| 30 daily runs × 50 topics | $13.515 |

Examples include the run-start charge. You are charged only for rows written to the dataset. The Actor respects the maximum total charge configured for the run.

### What can I build with it?

- Daily or hourly China trend dashboards
- Editorial and newsroom monitoring
- Content ideation based on rising topics
- Product-category and brand-interest comparisons
- Regional demand research
- Alerts when a keyword's interest changes
- Historical trend archives using Apify schedules

### Integrations

Connect results to Apify Schedules and Webhooks, Make, Zapier, Google Sheets, Slack, dashboards, warehouses, or your own API client. JSON and JSONL preserve the nested keyword time series most naturally; CSV and Excel remain available for spreadsheet workflows.

### FAQ

#### How fresh are current trends?

Current mode requests a fresh ranking during the run. `scrapeTimestamp` records exactly when each row was produced.

#### Is keyword analysis the same as the current hot-topic board?

No. Current mode is a ranking snapshot. Keyword mode returns a date-indexed interest series for terms you choose.

#### Can I analyze more than five keywords?

Each run supports up to five keywords. Use multiple tasks or runs for larger sets.

#### Can I export the nested time series to CSV?

Yes, though JSON or JSONL preserves `interestOverTime` most naturally. CSV and Excel serialize the nested array in one cell.

### Related Douyin Actors

| Actor | Best for |
|---|---|
| [Douyin Creator Scraper](https://apify.com/happy_b/douyin-creator-scraper) | Discover public accounts from a niche, name, or brand |
| [Douyin Profile Scraper](https://apify.com/happy_b/douyin-profile-scraper) | Resolve known accounts and optionally export public posts |
| [Douyin Search Scraper](https://apify.com/happy_b/douyin-search-scraper) | Find public videos by keyword with engagement and creator data |

### Legal and responsible use

Trend rows are public topic-level data, but downstream use can still be regulated. Review Douyin's [User Service Agreement](https://www.douyin.com/agreements/?id=6773906068725565448), [Privacy Policy](https://www.douyin.com/privacy/), and the laws applicable to your collection, storage, publication, and analysis.

### Support

For a bug or feature request, [open an Apify issue](https://apify.com/happy_b/douyin-trend-scraper/issues/open). Include the run ID, selected mode, expected behavior, and input with sensitive values removed.

# Actor input Schema

## `mode` (type: `string`):

Fetch base-priced current ranking rows or keyword-history rows that each receive the documented keyword-analysis add-on charge.

## `trendType` (type: `string`):

Which ranking to return in Current trends mode.

## `maxResults` (type: `integer`):

Maximum number of rows returned in Current trends mode.

## `keywords` (type: `array`):

One to five terms to compare. Each returned term is one separately charged base row plus the documented keyword-analysis add-on.

## `startDate` (type: `string`):

Start of the analysis window in YYYY-MM-DD format. Defaults to 29 days before the end date.

## `endDate` (type: `string`):

End of the analysis window in YYYY-MM-DD format. Defaults to today in UTC.

## `regions` (type: `array`):

Optional Chinese province or city names for keyword analysis. Leave empty for nationwide data.

## Actor input object example

```json
{
  "mode": "current",
  "trendType": "all",
  "maxResults": 50,
  "keywords": [
    "美食",
    "旅行"
  ],
  "regions": []
}
```

# Actor output Schema

## `trends` (type: `string`):

Current ranked topics or keyword time-series analysis.

## `metadata` (type: `string`):

Completion state, selected mode, result count, and sanitized errors.

# 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 = {
    "keywords": [
        "美食",
        "旅行"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("happy_b/douyin-trend-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 = { "keywords": [
        "美食",
        "旅行",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("happy_b/douyin-trend-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 '{
  "keywords": [
    "美食",
    "旅行"
  ]
}' |
apify call happy_b/douyin-trend-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,happy_b/douyin-trend-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/jgNIIHfEK7MhWaJcX/builds/5szEDZHql1KsIcnAN/openapi.json
