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 <YOUR_API_KEY> (required)

Request Body

ParameterTypeDescriptionRequiredDefault
videoUrlstringThe full URL of the TikTok video you want to get the transcript for.Yes
preferredLanguagestringThe 2-letter ISO 639-1 language code for the desired transcript language.Noen

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.
}

Response Headers:

  • 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"
}

Possible Error Messages:

  • videoUrl parameter is required
  • Invalid JSON in request body
  • Invalid 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"
}

Possible Error Messages:

  • 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 videoUrl parameter 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 2 credits per successful request. For more details on credit usage, see Credit Costs.

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.