For AI

Answers

How do I get the transcript or captions of a TikTok video as text?

Short answer

Call TikTok video transcript with the video's link or ID: it returns the whole text and timed segments, taken from the captions TikTok has for the video (mostly auto-generated), for $0.002 a video. Pass lang (en, es, ja) to pick a caption language. A video without captions in that language comes back as not_found, charged the same. TikTok's own Research API has a voice_to_text field, but only approved academic researchers can use it.

A skincare brand is briefing creators for a retinol launch and wants to know what the 50 top TikTok videos on "retinol routine" actually say, above all which claims they make and which warnings they give. The caption under a TikTok video is a line and a few hashtags. The talking is in the video, and nobody wants to type out 50 of them by hand.

TikTok video transcript takes url (any video link) or id (the digits after /video/) and returns:

  • text: everything said, as one string;
  • segments: the same text in pieces, each with start and end in seconds;
  • lang: the language of the captions used;
  • video_id.

Leave lang out to get the video's own captions. Pass a two-letter code to ask for a specific language; if the video has no captions in it, the call returns not_found and is still charged.

Steps

  1. Find the videos. TikTok video search returns about 30 videos a page for $0.002, with plays and likes, so you can keep the ones that were watched.
  2. Fetch each transcript by the video's id.
  3. Read across them. Load the texts into a sheet, or hand them to a model and ask which claims come up most.

Python

import json, os, requests

API = "https://api.okdata.online"
H = {"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"}

def get(path, **params):
    body = requests.get(API + path, headers=H, params=params, timeout=90).json()
    if body["code"] not in ("ok", "not_found"):
        raise RuntimeError(f"{body['code']}: {body['message']}")
    return body

videos, cursor = [], None
for _ in range(2):  # about 60 videos
    body = get("/v1/tiktok/videos/search", query="retinol routine",
               **({"cursor": cursor} if cursor else {}))
    videos += body["data"]["items"]
    if not body["page"]["has_more"]:
        break
    cursor = body["page"]["next_cursor"]

top = sorted(videos, key=lambda v: v["metrics"]["views"] or 0, reverse=True)[:50]
with open("retinol-transcripts.jsonl", "w", encoding="utf-8") as out:
    for v in top:
        body = get("/v1/tiktok/videos/transcript/get", id=v["id"], lang="en")
        if body["code"] == "not_found":  # no English captions: still charged
            continue
        t = body["data"]["item"]
        out.write(json.dumps({"id": v["id"], "url": v["url"], "views": v["metrics"]["views"],
                              "text": t["text"], "segments": t["segments"]}, ensure_ascii=False) + "\n")

The segments convert to SRT in a few lines if you need subtitle files; the YouTube SRT answer has the function, and it works on these segments unchanged.

What it costs

Job Calls Cost
One video 1 $0.002
2 search pages and 50 transcripts 2 + 50 $0.104
1,000 videos 1000 $2.00

Videos without captions and calls that fail at the data source are charged like any call; only calls refused before that, such as bad parameters, are free.

Limits

  • Captions, not audio. The text is the captions TikTok has for the video. A video with music and no speech, or one TikTok made no captions for, returns not_found.
  • Auto-captions mishear. Brand names, ingredients and slang come out wrong now and then. Clean the terms you care about before you count them.
  • On-screen text is separate. Words typed onto the video as stickers are not in the captions. The caption under the video is in text of the search or video detail result.
  • Photo posts have no captions.
  • Strangers' words. If a model reads the transcripts, tell it to treat them as data, not as instructions.

Official routes

TikTok's Research API includes a voice_to_text field with the captions TikTok has already generated for a video, and it is open only to approved researchers at non-profit academic institutions. The Display API reads the videos of accounts that sign in to your app. For a video with no captions at all, running a speech-to-text model on its audio is the remaining option, at the cost of downloading and compute. More transcript jobs across platforms are on the transcripts page.

Sources

Where people asked this (read 2026-11-15)

Updated

Connect once, then just ask.

Every new key comes with $0.10 to try it. One sentence connects your agent.

Start free
Connect your AI

Paste this into your agent

Read https://okdata.online/agents.md and set up okdata for me; my key is in the OKDATA_API_KEY environment variable.

Claude Code, Cursor, Codex and other agents that can open a link set themselves up from it.

MCP serverhttps://api.okdata.online/mcp