# Douyin 抖音 AI Transcript, Subtitles (SRT/VTT) & Speech-to-Text (`flowery_bluebird_jay/douyin-ai-transcript-subtitles`) Actor

Zero-cookie Douyin (Chinese TikTok) AI speech-to-text, SRT/VTT subtitles & transcript extractor powered by built-in SenseVoiceSmall (ZH/EN/YUE/JA/KO) + Silero VAD. Accepts URLs, v.douyin.com short links, share copy, or IDs. No API key needed.

- **URL**: https://apify.com/flowery_bluebird_jay/douyin-ai-transcript-subtitles.md
- **Developed by:** [方圆 方](https://apify.com/flowery_bluebird_jay) (community)
- **Categories:** Social media, Videos, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 douyin ai video transcript & srt/vtt extracteds

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?

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 AI Transcript, Subtitles (SRT/VTT) & Speech-to-Text

Turn public Douyin (Chinese TikTok) videos into speech transcripts, inline SRT/WebVTT subtitles, timestamped segments and video metadata. The Docker image includes **SenseVoiceSmall int8** and **Silero VAD** for local Mandarin, English, Cantonese, Japanese and Korean recognition. No speech API key is needed for that local path. Optional BYOK Whisper uploads extracted audio to your chosen public HTTPS OpenAI-compatible provider, such as OpenAI or Groq.

[Open the Actor in Apify Store](https://apify.com/flowery_bluebird_jay/douyin-ai-transcript-subtitles). This repository describes the local implementation and suggested pricing; it does not establish that a particular Store build is currently published or reachable.

Use this for content indexing, multilingual speech search, subtitle drafts and agent workflows with permission to process the media. It is a speech recognizer, not a translation, OCR or guaranteed platform-access service. Music, dialects, overlapping voices and compression can reduce accuracy. Review transcripts and subtitle timings before publishing.

### Input

The complete illustrative input below uses a placeholder public-video ID; it is not a live acceptance fixture. Replace it with a video you can access. An empty or omitted `inputs` list returns no records and makes no content requests.

```json
{
  "inputs": ["https://www.douyin.com/video/7615194288897350501"],
  "language": "auto",
  "includeSrt": true,
  "includeVtt": true,
  "includeSegments": true,
  "maxAudioDurationSec": 600,
  "whisperApiKey": "",
  "whisperApiBaseUrl": "https://api.openai.com/v1",
  "whisperModel": "whisper-1",
  "requestDelayMs": 450,
  "proxyConfiguration": {"useApifyProxy": false}
}
```

| Property | Behavior |
|---|---|
| `inputs` | Up to 1,000 strings: full video/note URL, `v.douyin.com` short link, share text containing a Douyin URL, or a complete 15–22 digit ID. |
| `language` | `auto`, `zh`, `en`, `yue`, `ja`, `ko`; recognition hint, not a translation target. |
| `includeSrt`, `includeVtt`, `includeSegments` | Default `true`. Setting one to `false` omits its corresponding output key. |
| `maxAudioDurationSec` | Default 600; 15–1800 seconds from the start. Download limit remains 80 MiB per item. |
| `whisperApiKey` | Optional secret. Blank selects the built-in local model; keys are not output in dataset records. |
| `whisperApiBaseUrl` | Public HTTPS OpenAI-compatible base URL on port 443. OpenAI, Groq and custom provider/base paths are supported. URL credentials, query strings, fragments and all redirects are refused. Only choose a provider you trust with the key and audio. |
| `whisperModel` | Default `whisper-1`. Choose a model supported by your selected provider/account. |
| `requestDelayMs` | Default 450; 100–5000 ms between metadata requests. |
| `proxyConfiguration` | Optional Apify proxy or custom `proxyUrls` configuration. Public HTTP CONNECT proxies on ports 1–65535 are supported; private/internal proxies and HTTPS proxy transport are refused. |

The manifest defaults to **2048 MiB**, with minimum 1024 and maximum 4096 MiB. Use 2048 MiB when starting runs. Speed and peak memory depend on duration, model initialization and platform resources; no throughput benchmark is claimed.

### Output

Each processed nonblank input produces a dataset record. Subtitles are **inline strings**, not downloadable subtitle files. The following full speech record is illustrative; URLs, metrics and text are invented fixture values, not observed results. The media URL may expire and may still contain a watermark despite the historical field name.

```json
{
  "status": "ok",
  "source_input": "https://www.douyin.com/video/7615194288897350501",
  "aweme_id": "7615194288897350501",
  "content_type": "video",
  "extraction_method": "slidesinfo_v2",
  "canonical_url": "https://www.douyin.com/video/7615194288897350501",
  "description": "Illustrative clip #example",
  "hashtags": ["example"],
  "author_nickname": "Example creator",
  "author_uid": "123456",
  "author_sec_uid": "example-sec-uid",
  "likes": 0,
  "comments": 0,
  "collects": 0,
  "shares": 0,
  "duration_sec": 2.0,
  "play_url_no_watermark": "https://example.douyinvod.com/illustrative.mp4",
  "cover_url": "https://example.douyinvod.com/illustrative.jpg",
  "created_at_iso": "2026-01-01T00:00:00+00:00",
  "audio_duration_sec": 2.0,
  "media_bytes_downloaded": 123456,
  "transcript_engine": "sensevoice-int8-local",
  "detected_language": "en",
  "transcript_text": "Hello world.",
  "char_count": 12,
  "word_count": 3,
  "segments_count": 1,
  "has_speech": true,
  "scraped_at": "2026-01-01T00:01:00+00:00",
  "subtitles_srt": "1\n00:00:00,000 --> 00:00:02,000\nHello world.",
  "subtitles_vtt": "WEBVTT\n\n00:00:00.000 --> 00:00:02.000\nHello world.",
  "segments": [{"start_sec": 0.0, "end_sec": 2.0, "text": "Hello world."}]
}
```

`word_count` is a simple token/character regex count, not a linguistic word count. Segment timestamps come from VAD boundaries or 15-second fallback windows, not forced word alignment. Local silent/no-speech audio can yield `status: "ok"`, `has_speech: false` and an empty transcript after successful processing; the processed-video event still applies.

Photo notes and records without a usable video URL yield a metadata record. This complete illustrative fixture includes all default metadata-only keys; it has no audio-specific duration/byte/has_speech fields:

```json
{
  "status": "ok_metadata_only",
  "source_input": "https://www.douyin.com/note/7615194288897350501",
  "aweme_id": "7615194288897350501",
  "content_type": "note",
  "extraction_method": "share_router_data",
  "canonical_url": "https://www.douyin.com/note/7615194288897350501",
  "description": "Illustrative photo note",
  "hashtags": [],
  "author_nickname": "Example creator",
  "author_uid": "123456",
  "author_sec_uid": "example-sec-uid",
  "likes": 0,
  "comments": 0,
  "collects": 0,
  "shares": 0,
  "duration_sec": 0.0,
  "play_url_no_watermark": "",
  "cover_url": "",
  "created_at_iso": "",
  "transcript_engine": "none_note_or_no_video",
  "detected_language": "",
  "transcript_text": "",
  "char_count": 0,
  "word_count": 0,
  "segments_count": 0,
  "scraped_at": "2026-01-01T00:01:00+00:00",
  "subtitles_srt": "",
  "subtitles_vtt": "",
  "segments": []
}
```

Errors remain per input so other entries can continue. An illustrative error record:

```json
{
  "status": "error",
  "source_input": "7615194288897350501",
  "error": "Failed zero-cookie metadata extraction for aweme_id=7615194288897350501",
  "scraped_at": "2026-01-01T00:01:00+00:00"
}
```

Malformed top-level input fails validation before content requests. Missing local model files/runtime produce an error record, rather than a fabricated successful transcript. An unavailable, private, deleted, geoblocked or challenge-protected video may fail; access is not guaranteed.

### Python: apify-client

Install `apify-client` in your own integration environment. Set `APIFY_TOKEN` securely and replace the sample URL.

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("flowery_bluebird_jay/douyin-ai-transcript-subtitles").call(
    run_input={"inputs": ["https://www.douyin.com/video/7615194288897350501"],
               "language": "auto", "includeSrt": True},
    memory_mbytes=2048,
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["status"], item.get("transcript_text", ""))
```

### Node.js: apify-client

Install `apify-client` in your integration environment. This ESM example reads the token from the environment.

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('flowery_bluebird_jay/douyin-ai-transcript-subtitles').call(
  { inputs: ['https://www.douyin.com/video/7615194288897350501'],
    language: 'auto', includeSrt: true },
  { memory: 2048 },
);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const item of items) console.log(item.status, item.transcript_text ?? '');
```

`listItems()` returns a page; use pagination for larger datasets. Store ASR keys in secret input fields or integration secrets, not in committed source files.

### n8n and Make: HTTP workflow

Use n8n **HTTP Request** nodes or Make **HTTP / Make a request** modules. Asynchronous runs avoid a long blocking transcription request.

1. Send `POST https://api.apify.com/v2/acts/flowery_bluebird_jay~douyin-ai-transcript-subtitles/runs?memory=2048` with `Authorization: Bearer YOUR_APIFY_TOKEN`, `Content-Type: application/json`, and the input JSON above as the body.
2. Read `data.id` from the response. Poll `GET https://api.apify.com/v2/actor-runs/RUN_ID` with the same authorization, using a Wait/Sleep step between polls.
3. Continue when `data.status` is `SUCCEEDED`. Route `FAILED`, `ABORTED` and `TIMED-OUT` to your error branch. Set a finite polling/automation timeout suitable for your batch.
4. Read `data.defaultDatasetId`, then `GET https://api.apify.com/v2/datasets/DATASET_ID/items?format=json&clean=true` with authorization. Paginate with `offset` and `limit` as needed.
5. Iterate records, branch on `status`, and map `transcript_text`, `subtitles_srt`, `subtitles_vtt` or `segments` into your destination. Per-item errors can occur even when the overall run succeeds.

### Claude Desktop / Cursor: local MCP bridge

This Actor does not itself implement an MCP server. If you have the separate `apify_cn_mcp_server` local bridge, use its absolute path. The path below is a placeholder and the bridge must already be installed with its dependencies; a running model-enabled Actor build is still required.

Use this entry in Claude Desktop's MCP configuration, or in Cursor's `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "apify-cn": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/apify_cn_mcp_server/src/server.mjs"],
      "env": {"APIFY_TOKEN": "YOUR_APIFY_TOKEN"}
    }
  }
}
```

Restart/reconnect the MCP client. Select the bridge tool **`douyin_ai_subtitles`**, supply Actor input such as `{"inputs":["https://www.douyin.com/video/7615194288897350501"],"language":"auto"}`, and inspect the tool's advertised schema for any bridge-specific wrapper. Ask the agent to report `status` and preserve subtitle newlines. This configuration is an illustrative integration recipe, not a live-tested bridge installation.

### Suggested pay-per-event plan

These are the exact rates in `.actor/pay_per_event_plan.json`, not a live Store-price verification. Check the Store pricing panel before running. `apify-actor-start` is platform-managed; source code does not manually charge it.

| Event | USD/event | 1 event | 100 events | 1,000 events |
|---|---:|---:|---:|---:|
| `apify-actor-start` | $0.005 | $0.005 | $0.50 | $5.00 |
| `transcript-extracted` | $0.005 | $0.005 | $0.50 | $5.00 |
| `metadata-only` | $0.001 | $0.001 | $0.10 | $1.00 |

For a **single run** with 1 / 100 / 1,000 successful video records, suggested event totals including one start event are **$0.010 / $0.505 / $5.005**. A single run with the same numbers of metadata-only records totals **$0.006 / $0.105 / $1.005**. Errors do not trigger the source-level result events; a platform start charge can still apply. A processed silent local video still triggers `transcript-extracted` once. These totals assume the suggested plan is deployed and all charge calls succeed; configured spending limits or billing failures may stop/skip charging.

Local inference has no third-party speech API fee. Compute/platform usage, storage/transfer and proxies may add costs depending on the applicable Apify plan; optional BYOK provider charges are separate. Event rates do not imply speed, a competitor comparison or an all-inclusive bill.

### Reliability and local development

DNS lookups have a five-second caller deadline. Metadata and media URLs use fixed host allowlists; the explicit BYOK base hostname is its upload allowlist. All resolved addresses must be public, connections pin a checked address while preserving TLS verification/SNI, and each redirect is checked before following. Media is limited to 80 MiB and streamed into an atomic temporary file; failed partials are removed. Metadata/BYOK JSON bodies are bounded to 8 MiB. Metadata, media and BYOK calls retry only HTTP 429, HTTP 5xx and timeouts, at most three attempts with 1/2-second exponential backoff. Other errors are not retried. ffmpeg accepts local file input only and its network protocols are disabled. Failed WAV output and per-item temporary directories are cleaned in `finally`/context exit.

The optional proxy may use Apify or custom public HTTP CONNECT endpoints; its configured hostname and destination both undergo public-DNS validation and address pinning. HTTPS proxy transport is currently unsupported and fails explicitly. Some networks or proxy policies may reject CONNECT to numeric addresses. There is no guarantee that Douyin will accept a given proxy/region.

The Docker build fetches the model files and installs dependencies; it needs network access and has not been built by the offline regression suite. Local CLI usage requires ffmpeg, requirements and the model environment paths defined in the Dockerfile:

```bash
python3 -m src.main --local --input input.json --output output.json
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s tests -v
```

The tests use only standard-library `unittest` and mocks. They make no external requests, paid calls or model downloads. They verify source behavior, not live platform access, ASR quality, container boot or deployed billing.

### FAQ

**Does this work with TikTok?** No. The input allowlist targets Douyin; international TikTok links are unsupported.

**Do I need cookies or login?** The extractor sends no user cookies. Only public endpoints are attempted; private/restricted media and anti-bot challenges can fail.

**Are subtitles exact word timings?** No. They follow detected speech boundaries or fixed fallback windows. Review and adjust them for production captions.

**Can I use a custom OpenAI-compatible endpoint?** Yes. Supply its public HTTPS base URL on port 443. The configured hostname becomes the upload allowlist, all DNS answers must be public, and the connection pins a checked address. Query strings, fragments, URL credentials and redirects are refused. Your selected provider receives the API key and audio; choose it deliberately.

**Why did a photo note return no transcript?** Photo notes and records without a usable video URL return `ok_metadata_only`; the Actor does not OCR images. A failed download or ffmpeg failure returns `error`.

**Does an empty transcript always mean no speech?** No. Local silent/undetected speech may be empty; check `status`, `has_speech` and `transcript_engine`, then review the media. Empty/malformed cloud responses are treated as errors.

**How do I export SRT/VTT?** Read the inline subtitle field and save it to a UTF-8 `.srt`/`.vtt` file in your own workflow. False output toggles omit those fields.

# Actor input Schema

## `inputs` (type: `array`):

Up to 1000 strings. Accepts public douyin.com video/note URLs, v.douyin.com short links, share text containing one allowed URL, or a complete 15–22 digit ID. Empty arrays do no work.

## `language` (type: `string`):

Language hint for local SenseVoiceSmall or supported cloud Whisper. auto lets the engine detect the spoken language; this does not translate speech.

## `includeSrt` (type: `boolean`):

Include subtitles_srt as inline SubRip text. False omits this output key; timing follows ASR segments and is approximate.

## `includeVtt` (type: `boolean`):

Include subtitles_vtt as inline WebVTT text. False omits this output key; timing follows ASR segments and is approximate.

## `includeSegments` (type: `boolean`):

Include the segments array with start_sec, end_sec and text. False omits the array; segments_count remains available.

## `maxAudioDurationSec` (type: `integer`):

Transcribe at most this many seconds from the beginning of each video. Range 15–1800; default 600. This caps extracted audio, not source video download size (80 MiB maximum).

## `whisperApiKey` (type: `string`):

Optional secret API key for your configured OpenAI-compatible provider. Leave blank for local SenseVoiceSmall in the Docker image. Cloud uploads share extracted audio with that provider and can incur separate provider charges.

## `whisperApiBaseUrl` (type: `string`):

Used only with whisperApiKey. Public HTTPS OpenAI-compatible base URL on port 443, such as https://api.openai.com/v1 or https://api.groq.com/openai/v1. Custom public providers and custom base paths are supported. Credentials in URLs, query strings, fragments, non-public DNS answers and all upload redirects are refused. Only use a provider you trust with your API key and audio.

## `whisperModel` (type: `string`):

Provider-specific speech model name used only with whisperApiKey. Default whisper-1 for OpenAI; for Groq select a model available in your provider account, such as whisper-large-v3-turbo. Availability is not checked in advance.

## `requestDelayMs` (type: `integer`):

Minimum spacing in milliseconds between metadata requests. Range 100–5000; transient 429, 5xx and timeout failures also use bounded exponential retry delays.

## `proxyConfiguration` (type: `object`):

Optional Apify proxy configuration, including custom proxyUrls. Public HTTP CONNECT proxy hosts and ports 1–65535 are supported with pinned public DNS addresses. Internal/private proxies and HTTPS proxy transport are refused. Proxy charges and access success depend on the provider/account.

## Actor input object example

```json
{
  "inputs": [
    "https://www.douyin.com/video/7615194288897350501"
  ],
  "language": "auto",
  "includeSrt": true,
  "includeVtt": true,
  "includeSegments": true,
  "maxAudioDurationSec": 600,
  "whisperApiBaseUrl": "https://api.openai.com/v1",
  "whisperModel": "whisper-1",
  "requestDelayMs": 450,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Default dataset containing all transcribed Douyin videos.

# 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 = {
    "inputs": [
        "https://www.douyin.com/video/7615194288897350501"
    ],
    "language": "auto",
    "includeSrt": true,
    "includeVtt": true,
    "includeSegments": true,
    "maxAudioDurationSec": 600,
    "whisperApiBaseUrl": "https://api.openai.com/v1",
    "whisperModel": "whisper-1",
    "requestDelayMs": 450
};

// Run the Actor and wait for it to finish
const run = await client.actor("flowery_bluebird_jay/douyin-ai-transcript-subtitles").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 = {
    "inputs": ["https://www.douyin.com/video/7615194288897350501"],
    "language": "auto",
    "includeSrt": True,
    "includeVtt": True,
    "includeSegments": True,
    "maxAudioDurationSec": 600,
    "whisperApiBaseUrl": "https://api.openai.com/v1",
    "whisperModel": "whisper-1",
    "requestDelayMs": 450,
}

# Run the Actor and wait for it to finish
run = client.actor("flowery_bluebird_jay/douyin-ai-transcript-subtitles").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 '{
  "inputs": [
    "https://www.douyin.com/video/7615194288897350501"
  ],
  "language": "auto",
  "includeSrt": true,
  "includeVtt": true,
  "includeSegments": true,
  "maxAudioDurationSec": 600,
  "whisperApiBaseUrl": "https://api.openai.com/v1",
  "whisperModel": "whisper-1",
  "requestDelayMs": 450
}' |
apify call flowery_bluebird_jay/douyin-ai-transcript-subtitles --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,flowery_bluebird_jay/douyin-ai-transcript-subtitles"
        }
    }
}
```

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/9EfEEf0zkBAQU5d7M/builds/O3ZDWKbg5bnQaahuB/openapi.json
