Skip to content

How to get TikTok video transcripts with an API

Updated · 1 step

TikTok writes captions for many videos, either through its own speech recognition or from the creator. Fetchproof returns those captions for any public video URL, so you can search, summarise or translate what a video says without downloading it or paying for transcription.

One call returns the transcript three ways: text for search and summaries, transcript_with_timestamp for timed segments, and transcript as WebVTT for subtitle players.

Request the transcript

Pass the video URL. language takes a two-letter code such as en or es. Leave it out to get the video's original captions.

GET /v1/tiktok/video/transcript 1 credit per call

cURL

curl --request GET 'https://api.fetchproof.com/v1/tiktok/video/transcript?url=https%3A%2F%2Fwww.tiktok.com%2F%40nbcnews%2Fvideo%2F7709321258004909326&language=en' \
  --header 'x-api-key: YOUR_API_KEY'

JavaScript

const response = await fetch("https://api.fetchproof.com/v1/tiktok/video/transcript?url=https%3A%2F%2Fwww.tiktok.com%2F%40nbcnews%2Fvideo%2F7709321258004909326&language=en", {
  method: 'GET',
  headers: {
    'x-api-key': process.env.FETCHPROOF_API_KEY,
  },
});
const data = await response.json();
console.log(data);

Python

import os
import requests

response = requests.get(
    "https://api.fetchproof.com/v1/tiktok/video/transcript?url=https%3A%2F%2Fwww.tiktok.com%2F%40nbcnews%2Fvideo%2F7709321258004909326&language=en",
    headers={"x-api-key": os.environ["FETCHPROOF_API_KEY"]},
)
print(response.json())

Go

package main

import (
  "fmt"
  "io"
  "net/http"
  "os"
)

func main() {
  req, _ := http.NewRequest("GET", "https://api.fetchproof.com/v1/tiktok/video/transcript?url=https%3A%2F%2Fwww.tiktok.com%2F%40nbcnews%2Fvideo%2F7709321258004909326&language=en", nil)
  req.Header.Set("x-api-key", os.Getenv("FETCHPROOF_API_KEY"))
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}

PHP

<?php
$ch = curl_init("https://api.fetchproof.com/v1/tiktok/video/transcript?url=https%3A%2F%2Fwww.tiktok.com%2F%40nbcnews%2Fvideo%2F7709321258004909326&language=en");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    'x-api-key: ' . getenv('FETCHPROOF_API_KEY'),
  ],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Excerpt of published sample response Full response →
{
  "success": true,
  "credits_remaining": 100,
  "id": "7709321258004909326",
  "url": "https://www.tiktok.com/@nbcnews/video/7709321258004909326",
  "language": "en",
  "transcript": "WEBVTT\n\n\n00:00:00.060 --> 00:00:02.780\nTake a look at what prompted an emergency call in T…",
  "transcript_with_timestamp": [
    {
      "start": 0.06,
      "end": 2.78,
      "text": "Take a look at what prompted an emergency call in Texas."
    }
  ],
  "text": "Take a look at what prompted an emergency call in Texas. Animal Services officers responde…",
  "credits_charged": 1
}

What it costs

A returned transcript costs 1 credit. If the video has no captions in the language you asked for, the call costs 0 credits, so you can run a whole list of videos and pay only for the ones that have a transcript.

Set cache_max_age to accept a cached copy of the same transcript for 0 credits. If there isn't one, the call fetches live at the normal price.

What it doesn't do

Fetchproof returns captions TikTok already has. It does not run paid speech-to-text on videos that have no captions.

Try it with 100 free credits

Sign up with an email address, no card. Credits never expire. Errors cost 0 credits, and each endpoint page lists exactly what it charges.