# Douyin Hashtag Video List Scraper (`opspilot.cc/douyin-hashtag-video-list`) Actor

- **URL**: https://apify.com/opspilot.cc/douyin-hashtag-video-list.md
- **Developed by:** [wang wei](https://apify.com/opspilot.cc) (community)
- **Categories:**
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.10 / actor start

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Hashtag Video List Scraper

**EN — Get the video list of a Douyin hashtag by its numeric `ch_id`, with cursor-based pagination.** Returns up to `count` videos per page (1-50) with full metadata: video id, description, cover URL, play URL, share URL, engagement counts (likes / shares / comments / plays), and author profile. Use the returned `cursor` + `hasMore` to walk the full list.

**ZH — 抖音话题作品列表 — 通过 `ch_id` 抓取作品视频列表,支持 cursor 翻页。** 每次返回最多 `count` 条(1-50):作品 ID、文案、封面、播放地址、分享链接、互动数据(点赞/分享/评论/播放)、作者资料。利用返回的 `cursor` + `hasMore` 可以拉完整个话题。

Built for **viral-content mining**, **competitor research**, **UGC sourcing**, **influencer analytics**, and **trend monitoring** on Douyin — China's #1 short-video platform.

**5 free runs / day.** No API key required — the Actor's built-in upstream key is already configured.

### Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `chId` | string | yes | — | Douyin challenge id. Accept both numeric and string forms (defensive parsing). |
| `cursor` | integer | no | `0` | Pagination cursor. Start at 0; pass the returned `cursor` from the previous page. |
| `sortType` | integer | no | `0` | Sort order — `0` = comprehensive (default), `1` = latest, `2` = hottest. |
| `count` | integer | no | `10` | Page size (1-50). Larger pages cost the same upstream request but push more items. |

```json
{
  "chId": "1575791821492238",
  "cursor": 0,
  "sortType": 0,
  "count": 10
}
```

### Output

The Actor pushes one item per video to the default dataset and writes a `SUMMARY` record with `cursor`, `hasMore`, and `uniqueItems` so you can resume pagination.

```json
{
  "rank": 1,
  "aweme_id": "7400000000000000000",
  "desc": "一段关于深海世界的唯美视频 🎬",
  "create_time": 1725984000,
  "duration_ms": 30500,
  "video_url": "https://play.douyin.com/aweme/v1/play/?video_id=...",
  "cover_url": "https://p11-sign.douyinpic.com/cover.jpeg",
  "share_url": "https://www.iesdouyin.com/share/video/7400000000000000000",
  "engagement": {
    "digg_count": 123456,
    "share_count": 5678,
    "comment_count": 901,
    "play_count": 2345678
  },
  "author": {
    "uid": "user_id",
    "nickname": "深海摄影师",
    "avatar_url": "https://p11-sign.douyinpic.com/avatar.jpeg"
  },
  "rawData": { /* full upstream aweme object */ }
}
```

**`SUMMARY` record (key-value store):**

```json
{
  "ok": true,
  "chId": "1575791821492238",
  "cursor": 0,
  "nextCursor": 5,
  "hasMore": true,
  "requests": 1,
  "uniqueItems": 0,
  "note": "Pass nextCursor as input.cursor on the next run to paginate."
}
```

### Pagination

```bash
## Page 1
apify call douyin-hashtag-video-list --input '{"chId":"1575791821492238","cursor":0,"count":10}'

## Page 2 — pass the nextCursor from the previous SUMMARY
apify call douyin-hashtag-video-list --input '{"chId":"1575791821492238","cursor":5,"count":10}'
```

Stop when `hasMore` flips to `false`.

### How to find a `chId`

The `chId` is the numeric challenge id Douyin assigns to every hashtag. See the dedicated guide in [`douyin-hashtag-detail` README → "How to find a chId"](../douyin-hashtag-detail/README.md#how-to-find-a-chid) for the three methods (hashtag page URL, share URL redirect, video hashtag chip) and the common mistakes (do not paste the full URL or the `ch_id=` query-string form).

**TL;DR:** open the canonical hashtag page in a desktop browser →

```
https://www.douyin.com/challenge/1575791821492238
                                  └──────── chId ────────┘
```

Copy the trailing number. For this Actor, `chId` accepts both integer and string forms (`1575791821492238` or `"1575791821492238"`) — defensive parsing handles both.

### Use it together with the other Douyin Actors

This Actor is part of the 5-Actor Douyin MVP set. Use it together with:

| Where in the pipeline | Actor | Use it to |
|---:|---|---|
| you are here | **Douyin Hashtag Video List Scraper (you are here)** | (this Actor) |
| before / step ① | [Douyin Hashtag Search Scraper](../douyin-hashtag-search/README.md) | keyword search → get topic\_id (= ch\_id) for the hashtag you want to crawl |
| before / step ② | [Douyin Hashtag Detail Scraper](../douyin-hashtag-detail/README.md) | get the ch\_info (view\_count, user\_count, share info) for the same ch\_id before crawling videos |
| sister Actor | [Douyin Hot Search List Scraper](../douyin-hot-search-list/README.md) | board-level trends — discover rising boards whose videos you want to crawl |
| sister Actor | [Douyin Live Hot Search List Scraper](../douyin-live-hot-search-list/README.md) | live-stream specific trends |

**You are here:** **Douyin Hashtag Video List Scraper** — run this on its own for the upstream use case described above, or chain it with the other 4 Actors for a full Douyin keyword → hashtag → videos → trends pipeline.

### Use cases

| Persona | Use it for |
|---|---|
| UGC sourcer | Mine videos under a hashtag for top-performing content to remix or react to |
| Competitor analyst | Walk the full video list of a rival brand's challenge to spot trends and gaps |
| Influencer marketer | Pull the top videos under a vertical hashtag and reach out to the authors |
| Trend researcher | Sample the first 50-200 videos under a challenge to gauge the audience mix |
| Content ops | Export full video metadata + author profiles into your CRM |

### Why this Actor exists

Douyin challenges surface thousands to millions of videos. Walking them with the upstream cursor protocol is the only way to do bulk analysis. This Actor is the **step ② follow-up** of the 4-Actor Douyin MVP set — pair it with `douyin-hashtag-detail` to go from challenge name to videos.

### Pricing

Free users are limited to **5 runs per day**. Paid users (`APIFY_USER_IS_PAYING=1`) have unlimited runs. The Actor itself adds no markup — you pay the upstream provider per request plus the standard Apify compute unit cost.

### Test locally

```bash
cd douyin-hashtag-video-list
UPSTREAM_API_KEY=... UPSTREAM_BASE_URL=<your-upstream-base-url> npm test
```

### Output schema

See `.actor/output_schema.json` for the full type schema, or read it at runtime via the Apify API.

### License

MIT

# Actor input Schema

## `chId` (type: `string`):

Hashtag id (treated as string to preserve leading zeros in older IDs).

## `cursor` (type: `integer`):

Pagination cursor. First page = 0, subsequent pages = the cursor returned in the previous response.

## `sortType` (type: `string`):

"0" = 综合排序 (default), "1" = 最多点赞, "2" = 最新发布. Coerced to integer in normalize layer.

## `count` (type: `integer`):

Items per page (default 10). Upstream warns: keep the default to avoid bugs.

## Actor input object example

```json
{
  "cursor": 0,
  "sortType": "0",
  "count": 10
}
```

# Actor output Schema

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

One normalized dataset item per matched item. See output\_schema section of README for the per-actor item shape (topic\_id/ch\_id, hot\_value, engagement metrics, etc.).

## `summary` (type: `string`):

Run-level summary: input params (keyword / chId / boardType / etc.), requests, uniqueItems, itemsPushed, activeTime, tier (paid/free/free-unchecked), runsToday, dailyLimit, notes.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("opspilot.cc/douyin-hashtag-video-list").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("opspilot.cc/douyin-hashtag-video-list").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 '{}' |
apify call opspilot.cc/douyin-hashtag-video-list --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,opspilot.cc/douyin-hashtag-video-list"
        }
    }
}

```

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/STaeVKnyAfyNl3o9V/builds/SPkLvgX44GaF9cN79/openapi.json
