TikTok transcript API
What is said in a TikTok video, from the caption track TikTok made for it: the WebVTT file, plain text and timed segments, in the original language or a translation.
GET /v1/tiktok/videos/{id}/transcript1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/tiktok/videos/7707446852798549279/transcript",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "itemId": "7707446852798549279", "language": "eng-US", "source": "ASR", "webvtt": "WEBVTT\n\n\n00:00:00.380 --> 00:00:02.740\ngarlic butter steak bites and potatoes\n\n00:00:02.741 --> 00:00:05.861\nlet's make …", "text": "garlic butter steak bites and potatoes let's make it first you're gonna wash and peel and dice your russet potatoes into…", "segments": [ { "start": 0.38, "end": 2.74, "text": "garlic butter steak bites and potatoes" }, { "start": 2.741, "end": 5.861, "text": "let's make it first you're gonna wash and peel and dice" } ], "subtitleInfos": [ { "Format": "webvtt", "LanguageCodeName": "eng-US", "LanguageID": "2", "Size": 1639, "Source": "ASR", "Url": "https://v16m-webapp.tiktokcdn-us.com/af4491975f5a9c37d168d840db7a7da5/6b08c4d5/video/tos/useast8/tos-useast8-v-0068-tx2/…", "UrlExpire": 1795736789, "Version": "1:big_caption" } ]}Parameters
| Name | Type | Description |
|---|---|---|
idpath · required | string | A video (or photo post) id, or its URL (www.tiktok.com/@user/video/<id>). Example: 7707446852798549279. |
languagequery | string | Language code, e.g. en, es, pt-BR. |
Response fields
200 with a TikTokTranscriptResponse, in TikTok’s own web JSON (itemStruct, userInfo, comments).
| Field | Type | Description |
|---|---|---|
itemId | string | Video id, as a decimal string. |
language | string | The track’s language code, e.g. eng-US. |
source | string | Who made the track: ASR (TikTok’s auto captions), MT (machine translation) or the creator. |
webvtt | string | The track as TikTok serves it (WebVTT). |
text | string | The cues joined into plain text. |
segments | object[] | |
subtitleInfos | object[] | Every track TikTok lists for the video (languages, formats). |
Status codes
| Status | Meaning |
|---|---|
200 | The transcript. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The account, video, comment, hashtag or sound does not exist on TikTok, or was removed. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | TikTok is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
What if a video has no speech?
TikTok makes no caption track for it, so it answers 404 target_not_found, never charged.
TikTok is a trademark of ByteDance Ltd. We are not affiliated with or endorsed by TikTok or ByteDance.