# Douyin Hot Search Trends Scraper (`automation-lab/douyin-hot-search-trends`) Actor

Export the current Douyin hot-search ranking with topic text, rank, heat, labels, source timing, links, and retrieval timestamps.

- **URL**: https://apify.com/automation-lab/douyin-hot-search-trends.md
- **Developed by:** [Automation Lab](https://apify.com/automation-lab) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.36 / 1,000 item extracteds

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?

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 Hot Search Trends Scraper

Export the current **Douyin search** ranking as structured, timestamped topic records.
The Actor collects up to 50 positions from Douyin's public ranking surface and returns topic text, rank, heat value, label, source time, event time, identifiers, counts, links, and retrieval time.

Use it to capture one snapshot or schedule recurring runs for China social-trend monitoring.
No Douyin account, cookies, browser, or user-supplied proxy is required.

### What does this Actor do?

The Actor retrieves Douyin's current hot-search list and normalizes every selected topic into one dataset row.
It can:

- export the top results or a selected rank window;
- filter out topics below a minimum heat value;
- include or omit temporary cover image URLs;
- preserve both Douyin's source time and the Actor retrieval time;
- create direct Douyin search links for every topic;
- fail clearly when the upstream response is blocked, empty, or malformed.

This is a current snapshot scraper.
It does not invent historical data.
To build history, schedule the Actor and store each run's dataset.

### Who is it for?

Typical users include:

- social-media analysts tracking fast-moving China trends;
- brand and campaign teams checking which topics are gaining attention;
- news and research teams archiving ranked topic snapshots;
- data engineers feeding trend records into a warehouse or spreadsheet;
- content teams looking beyond the top ten into the full ranking.

### Why use it?

Each output row is immediately usable in JSON, CSV, Excel, webhooks, and Apify integrations.
Unlike a screenshot, the data keeps rank and heat as numbers and timestamps as machine-readable ISO 8601 values.

The Actor uses a lightweight Douyin-owned JSON surface.
It avoids browser startup and does not fetch video media.
A sibling Douyin host provides a bounded fallback if the primary host has a transient failure.

### What data can I extract?

| Field | Meaning |
| --- | --- |
| `topicText` | Topic text shown in the hot-search list |
| `rank` | Current one-based rank |
| `heatValue` | Popularity value exposed by Douyin |
| `label` | Normalized badge such as `Hot` or `New`, when present |
| `labelCode` | Original numeric Douyin badge code |
| `sourceTime` | Ranking update time reported by Douyin |
| `eventTime` | Topic event time reported by Douyin |
| `url` | Direct Douyin search URL for the topic |
| `sourceUrl` | Douyin-owned API surface used for the snapshot |
| `sentenceId` | Stable topic sentence identifier |
| `groupId` | Related content group identifier |
| `videoCount` | Video count when exposed |
| `discussVideoCount` | Discussion-video count when exposed |
| `categoryCode` | Original topic category code |
| `wordType` | Original word-type code |
| `imageUrl` | Temporary cover image URL when requested |
| `retrievedAt` | Time this Actor retrieved the record |

Source fields can be absent for some topics.
Nullable schema fields keep these upstream variations explicit.

### How to scrape Douyin hot search trends

1. Open the Actor in Apify Console.
2. Keep the default rank range for the full current list, or choose a smaller range.
3. Optionally set a minimum heat value.
4. Choose whether to include cover image URLs.
5. Click **Start**.
6. Open the **Dataset** tab to inspect, export, or integrate the results.

The default input is ready to run without credentials.

### Input parameters

#### `maxItems`

Maximum records saved after filtering.
Allowed range: 1–50.
Default: 50.

#### `minRank`

First rank to include.
Default: 1.

#### `maxRank`

Last rank to include.
Allowed maximum: 50.
Default: 50.

#### `minHeat`

Minimum Douyin heat value.
Use `0` to keep all selected ranks.
Default: 0.

#### `includeImages`

Includes a source-provided cover URL when available.
These signed image URLs are temporary, so archive the image separately if your workflow needs it later.
Default: `true`.

### Input example

```json
{
  "maxItems": 10,
  "minRank": 1,
  "maxRank": 10,
  "minHeat": 0,
  "includeImages": true
}
```

For ranks 11–25:

```json
{
  "maxItems": 15,
  "minRank": 11,
  "maxRank": 25,
  "includeImages": false
}
```

### Output example

A current result has this shape:

```json
{
  "topicText": "Example festival travel tips",
  "rank": 1,
  "heatValue": 9876543,
  "label": "Hot",
  "labelCode": 3,
  "sourceTime": "2025-01-15T04:00:00.000Z",
  "eventTime": "2025-01-15T03:30:00.000Z",
  "url": "https://www.douyin.com/search/Example%20festival%20travel%20tips",
  "sourceUrl": "https://aweme-hl.snssdk.com/aweme/v1/hot/search/list/",
  "sentenceId": "1234567",
  "groupId": "7123456789012345678",
  "videoCount": 24,
  "discussVideoCount": 5,
  "categoryCode": 5000,
  "wordType": 1,
  "imageUrl": null,
  "retrievedAt": "2025-01-15T04:01:00.000Z"
}
```

Dates shown here are illustrative and anonymized.
Actual runs return current Douyin data.

### How much does it cost to export Douyin hot-search topics?

Pricing uses two charge events:

- a one-time **Actor start** charge of **$0.005 per run**;
- a tiered **hot-search topic** charge for each saved row.

At the BRONZE tier, the per-topic price is **$0.005592**.
Approximate BRONZE examples are:

| Saved topics | BRONZE estimate formula |
| ---: | --- |
| 10 | $0.005 start + 10 × $0.005592/topic |
| 25 | $0.005 start + 25 × $0.005592/topic |
| 50 | $0.005 start + 50 × $0.005592/topic |

The applicable tier in your Apify account can differ.
The Console run estimate and active pricing are authoritative.
Failed or filtered records are not charged as topic events.
Platform billing can be adjusted for refunds, disputes, fraud, taxes, corrections, or clawbacks.

### Scheduled trend monitoring

A single run captures the current ranking only.
For recurring monitoring:

1. create an Apify Schedule;
2. run every hour or at the interval your analysis needs;
3. export each run dataset to your storage destination;
4. compare rows by `sentenceId`, `rank`, `heatValue`, `sourceTime`, and `retrievedAt`.

This lets you identify new topics, removed topics, rank changes, and heat changes without the Actor claiming to provide source history.

### Export and integration workflows

You can:

- download JSON, CSV, XML, RSS, or Excel from the Dataset tab;
- connect the run to Google Sheets;
- trigger a webhook when the run finishes;
- use Make or Zapier for recurring delivery;
- read datasets with the Apify API client;
- load timestamped snapshots into BigQuery, Snowflake, or another warehouse.

Use `sentenceId` as the preferred source identifier when it is present.
Use `topicText` plus `sourceTime` as a fallback comparison key.

### API: cURL

Start a run synchronously and return dataset items:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~douyin-hot-search-trends/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"maxItems":10,"minRank":1,"maxRank":10,"includeImages":false}'
```

Keep your Apify token in a secret or environment variable.
Do not commit it to source control.

### API: JavaScript

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/douyin-hot-search-trends').call({
  maxItems: 50,
  minRank: 1,
  maxRank: 50,
  includeImages: false,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### API: Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('automation-lab/douyin-hot-search-trends').call(run_input={
    'maxItems': 25,
    'minRank': 1,
    'maxRank': 25,
    'includeImages': False,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

### Use with MCP and AI assistants

The Actor itself does not use AI or send data to an AI provider. An MCP client may pass results to the model you configure.

#### Claude Code

Add this Actor through Apify MCP:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/douyin-hot-search-trends"
```

#### Claude Desktop, Cursor, and VS Code

Claude Desktop, Cursor, and VS Code clients can use this equivalent MCP JSON configuration:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/douyin-hot-search-trends"
    }
  }
}
```

Example prompts:

- “Get the current top 10 Douyin hot searches and summarize the dominant themes.”
- “Export ranks 11–25 without images and return a CSV-ready table.”
- “Run the full snapshot and compare its IDs and ranks with yesterday's dataset.”

The comparison prompt requires you to provide or connect the earlier dataset.

### Reliability and retry behavior

The Actor validates the response before saving anything.
A successful upstream response must be JSON, report source status zero, and contain at least one hot-search topic.

Transient failures receive up to three requests across two Douyin-owned hosts with short exponential backoff.
The Actor does not rotate paid proxies or launch a browser automatically.
If all attempts fail, the run fails with a diagnostic message instead of returning a misleading empty dataset.

### Limits

- Douyin currently exposes up to 50 topics through this ranking surface.
- The Actor returns current data, not historical rankings.
- Heat values and labels are source-defined and can change without notice.
- Some topic records omit counts, labels, images, or IDs.
- Cover URLs can expire.
- Douyin pages can be region-sensitive when opened outside the Actor.
- The Actor does not scrape videos, comments, profiles, or keyword search result pages.

### Troubleshooting

#### Why did my run return fewer rows than `maxItems`?

Your rank window or `minHeat` filter may leave fewer eligible topics.
The source can also expose fewer than 50 usable rows.
Check the run log for the saved count.

#### Why is `label` null?

Many topics have source label code `0`, meaning no displayed badge.
Unknown non-zero codes are preserved as `Code N` and always remain available in `labelCode`.

#### Why does an image URL no longer load?

Douyin image URLs are signed and temporary.
Enable images only when needed and download them during your workflow if long-term access is required.

#### Why did the run fail instead of returning an empty dataset?

An empty or malformed hot list is usually an upstream delivery problem, not a truthful “no trends” result.
Failing clearly protects scheduled monitoring from silently recording false empty snapshots.

### Legality and responsible use

This Actor retrieves publicly exposed trend-ranking metadata and is not affiliated with or endorsed by Douyin or ByteDance.
You are responsible for following applicable laws, Douyin terms, Apify policies, and your organization's data-retention rules.

Do not use the output for harassment, discrimination, unlawful surveillance, or attempts to identify private individuals.
Avoid treating popularity rankings as verified facts or endorsements.
Review source context before publishing analysis based on a topic.

### Related automation-lab Actors

For broader Douyin video and creator metrics, see [Douyin Analytics Scraper](https://apify.com/automation-lab/douyin-analytics-scraper).
It covers a different entity and workflow: video/creator analytics rather than current ranked hot-search topics.

### FAQ

#### Does it need a Douyin login?

No.
The supported current-ranking route does not require an account or cookies.

#### Does it use residential proxies?

No.
The shipped route uses direct lightweight HTTP requests.

#### Can it track rank changes automatically?

Schedule repeated runs and compare their datasets.
The Actor supplies source and retrieval timestamps but does not keep a hidden cross-run history.

#### Can I request more than 50 topics?

No.
The current source list contains at most 50 ranking positions, and the input rejects larger limits.

#### Can I filter by keyword?

Not in this release.
Rank and heat filters are deterministic against every current snapshot; keyword filtering is easy to apply downstream without changing source coverage.

# Changelog

This Actor's version history is a separate document: https://apify.com/automation-lab/douyin-hot-search-trends/changelog.md

# Actor input Schema

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

Maximum number of ranked topics to save after applying rank and heat filters.

## `minRank` (type: `integer`):

First ranking position to include. Use 1 to start at the top topic.

## `maxRank` (type: `integer`):

Last ranking position to include, up to Douyin's current 50-topic list.

## `minHeat` (type: `integer`):

Keep only topics whose Douyin heat value is at least this integer. Use 0 to keep every topic.

## `includeImages` (type: `boolean`):

Include the temporary public cover image URL exposed with each topic when available.

## Actor input object example

```json
{
  "maxItems": 20,
  "minRank": 1,
  "maxRank": 20,
  "minHeat": 0,
  "includeImages": true
}
```

# Actor output Schema

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

Current ranked Douyin hot-search topics.

# 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 = {
    "maxItems": 20,
    "minRank": 1,
    "maxRank": 20,
    "minHeat": 0,
    "includeImages": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/douyin-hot-search-trends").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 = {
    "maxItems": 20,
    "minRank": 1,
    "maxRank": 20,
    "minHeat": 0,
    "includeImages": True,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/douyin-hot-search-trends").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 '{
  "maxItems": 20,
  "minRank": 1,
  "maxRank": 20,
  "minHeat": 0,
  "includeImages": true
}' |
apify call automation-lab/douyin-hot-search-trends --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/douyin-hot-search-trends"
        }
    }
}
```

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/3DiY2WCBoBh4xdD9x/builds/t39TWFlvEa0zttXek/openapi.json
