Get TikTok transcript
curl --request POST \
--url https://app.dumplingai.com/api/v1/get-tiktok-transcript \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"videoUrl": "<string>",
"preferredLanguage": "<string>"
}
'import requests
url = "https://app.dumplingai.com/api/v1/get-tiktok-transcript"
payload = {
"videoUrl": "<string>",
"preferredLanguage": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({videoUrl: '<string>', preferredLanguage: '<string>'})
};
fetch('https://app.dumplingai.com/api/v1/get-tiktok-transcript', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.dumplingai.com/api/v1/get-tiktok-transcript",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'videoUrl' => '<string>',
'preferredLanguage' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.dumplingai.com/api/v1/get-tiktok-transcript"
payload := strings.NewReader("{\n \"videoUrl\": \"<string>\",\n \"preferredLanguage\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.dumplingai.com/api/v1/get-tiktok-transcript")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"videoUrl\": \"<string>\",\n \"preferredLanguage\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dumplingai.com/api/v1/get-tiktok-transcript")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"videoUrl\": \"<string>\",\n \"preferredLanguage\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"transcript": "<string>",
"language": "<string>",
"id": "<string>",
"originalUrl": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Data APIs
Get TikTok Transcript
API endpoint to retrieve the transcript from a TikTok video.
POST
/
api
/
v1
/
get-tiktok-transcript
Get TikTok transcript
curl --request POST \
--url https://app.dumplingai.com/api/v1/get-tiktok-transcript \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"videoUrl": "<string>",
"preferredLanguage": "<string>"
}
'import requests
url = "https://app.dumplingai.com/api/v1/get-tiktok-transcript"
payload = {
"videoUrl": "<string>",
"preferredLanguage": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({videoUrl: '<string>', preferredLanguage: '<string>'})
};
fetch('https://app.dumplingai.com/api/v1/get-tiktok-transcript', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.dumplingai.com/api/v1/get-tiktok-transcript",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'videoUrl' => '<string>',
'preferredLanguage' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.dumplingai.com/api/v1/get-tiktok-transcript"
payload := strings.NewReader("{\n \"videoUrl\": \"<string>\",\n \"preferredLanguage\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.dumplingai.com/api/v1/get-tiktok-transcript")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"videoUrl\": \"<string>\",\n \"preferredLanguage\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dumplingai.com/api/v1/get-tiktok-transcript")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"videoUrl\": \"<string>\",\n \"preferredLanguage\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"transcript": "<string>",
"language": "<string>",
"id": "<string>",
"originalUrl": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Description
This endpoint allows you to retrieve the transcript of a TikTok video. It attempts to fetch the available transcript for the given video URL in the specified language.Endpoint
POST https://app.dumplingai.com/api/v1/get-tiktok-transcript
Request Headers
- Content-Type:
application/json(required) - Authorization: Bearer
<API_KEY>(required)
Request Body
| Parameter | Type | Description | Required | Default |
|---|---|---|---|---|
videoUrl | string | The full URL of the TikTok video you want to get the transcript for. | Yes | |
preferredLanguage | string | The 2-letter ISO 639-1 language code for the desired transcript language. | No | en |
Responses
Success (200 OK)
Returns the transcript of the specified TikTok video, the requested language, and identifiers from the transcript service. Response Body:{
"transcript": "string", // The transcript in WebVTT format.
"language": "string", // The language code that was requested.
"id": "string", // Optional. An identifier for the transcript from the service.
"originalUrl": "string" // Optional. The original video URL as returned by the service.
}
- Content-Type:
application/json - X-RateLimit-Limit: The rate limit for the user.
- X-RateLimit-Remaining: The remaining number of requests for the user.
Bad Request (400)
Returned if the request is invalid or missing required parameters, or if the underlying transcript service encounters an error with the request.{
"error": "Error message describing the issue"
}
videoUrl parameter is requiredInvalid JSON in request bodyInvalid TikTok videoUrl format.TikTok transcript API error: <details from service>(if the external service returns a structured error)Failed to get TikTok transcript: <details>(for other processing errors)
Unauthorized (401)
Returned if the API key is missing, invalid, or unauthorized.{
"error": "Error message describing the authentication issue"
}
Not Found (404)
Returned if the underlying service cannot find subtitles for the video, or in the requested language.{
"error": "No subtitles found for the TikTok video: <videoUrl>"
}
Internal Server Error (500)
Returned if there’s an unexpected error on our end or a critical error from the transcription service.{
"error": "Error message describing the issue"
}
Invalid response from TikTok transcript service: <details>TikTok transcript service API key not configured.(if server-side configuration is missing)
Example Request
Example Request
curl -X POST https://app.dumplingai.com/api/v1/get-tiktok-transcript \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"videoUrl": "https://www.tiktok.com/@username/video/1234567890123456789",
"preferredLanguage": "es"
}'
Example Request (Node.js)
import fetch from 'node-fetch';
const apiKey = 'YOUR_API_KEY';
const videoUrl = 'https://www.tiktok.com/@username/video/1234567890123456789';
const preferredLanguage = 'es'; // Optional
async function getTikTokTranscript() {
try {
const response = await fetch('https://app.dumplingai.com/api/v1/get-tiktok-transcript', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ videoUrl, preferredLanguage })
});
if (!response.ok) {
const errorData = await response.json();
console.error(`Error: ${response.status}`, errorData);
return;
}
const data = await response.json();
console.log('TikTok Transcript Data:', data);
} catch (error) {
console.error('Failed to fetch TikTok transcript:', error);
}
}
getTikTokTranscript();
Example Successful Response (200 OK)
The transcript is returned in WebVTT format.Example Response
{
"transcript": "WEBVTT\n\n00:00:00.120 --> 00:00:01.840\nThis is the first line of the transcript.\n\n00:00:02.000 --> 00:00:03.500\nAnd this is the second line.",
"language": "es",
"id": "7499229683859426602",
"originalUrl": "https://www.tiktok.com/@username/video/1234567890123456789"
}
Notes
- The
videoUrlparameter must be a valid TikTok video URL. - The availability of transcripts and specific languages depends on the TikTok video itself.
- The transcript is returned in WebVTT format. You may need to parse this format if you require plain text or structured timestamp data.
Credit Cost
This endpoint costs 10 credits per successful request. For more details, see our Credit Costs page.Rate Limiting
Rate limit headers (X-RateLimit-Limit and X-RateLimit-Remaining) are included in the response to indicate the user’s current rate limit status.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json