TikTok Transcript API Examples and Workflows
Complete scripts with captured runs.
Draft notice
Examples verified against the documented contract; live-API verification pending. Run tools/verify-live.sh with a real key and base URL, then remove this notice.
Chunk a TikTok Transcript for a RAG Index
Timed chunks for an index. Chunk a TikTok transcript for RAG: group timed segments into passages with start times and a source label. Tested Python script with captured output.
OpenSave a TikTok Transcript as SRT and VTT Files
Subtitle files with a check. Save a TikTok transcript as SRT and VTT subtitle files with Python, and check the files. Tested script with captured output and a language fallback note.
OpenFind a Phrase in a TikTok Transcript
Search with timing. Find a phrase in a TikTok transcript and print the time it is said, even when it spans two segments. Tested Python script with captured output.
OpenFetch Many TikTok Transcripts with Retries and Resume
Workers, retries, resume. Fetch many TikTok transcripts in Python with 3 workers, retries on retryable errors, job polling and resume. Tested script with captured output.
OpenHandle Missing TikTok Transcripts
Sort URLs by outcome. Sort a list of TikTok URLs into has captions, no captions, private and removed with ai_fallback off, so no speech-to-text job starts. Tested script.
OpenRead the details
These TikTok transcript API examples are complete workflows: a script you can save, a captured run, and notes on errors and credits.
- Five workflows, each with its own script.
- Scripts read the key and base URL from environment variables.
- Only documented parameters: url, lang, format, ai_fallback.
- A failed request costs nothing, so loops are safe to retry.
Each script calls the one transcript endpoint documented on this site and was run against a local mock that follows the assumed contract. Pick the job you have, copy the script and change the URL.
Get an API key to run them against the real service once the contract is confirmed, or open the playground to look at one response.
The five workflows
| Workflow | Job it does | Output |
|---|---|---|
| Chunk a transcript for RAG | Group segments into timed chunks | JSON lines |
| Save SRT and VTT files | Write and check subtitle files | .srt and .vtt |
| Find a phrase | Search, even across segments | Time and line |
| Fetch many transcripts | Workers, retries, jobs, resume | results.jsonl |
| Handle missing transcripts | Sort a URL list by outcome | Tally |
A workflow is published only after its script has run, and the page shows output from that run.
Frequently asked questions
Where can I find working TikTok transcript API examples?
Here. Each workflow has a full script, a captured output and notes on errors. Open the one that matches your task.
Do the scripts run against the real API?
Not yet. They run against a local mock that follows the assumed contract. Run them against your live API and fix any differences before launch.
Do I need Python?
Python is the main language. The API is plain HTTP, so any language works; the quickstart also shows Node.