> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dumplingai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get TikTok Transcript

> API endpoint to retrieve the transcript from a TikTok video.

## 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](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) 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:**

```json theme={null}
{
  "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.

```json theme={null}
{
  "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.

```json theme={null}
{
  "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.

```json theme={null}
{
  "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.

```json theme={null}
{
  "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

```bash Example Request theme={null}
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"
      }'
```

```javascript Example Request (Node.js) theme={null}
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.

```json Example Response theme={null}
{
  "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 **10 credits** per successful request. For more details, see our [Credit Costs](/api-reference/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.


## OpenAPI

````yaml POST /api/v1/get-tiktok-transcript
openapi: 3.0.3
info:
  title: DumplingAI API
  version: 1.0.0
  description: >
    REST API for DumplingAI's content intelligence and automation platform.

    All endpoints are grouped under `/api/v1`; most are secured via Bearer API
    keys unless an operation explicitly sets `security: []`.
servers:
  - url: https://app.dumplingai.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: YouTube
    description: Access metadata, search results, and transcripts from YouTube.
  - name: TikTok
    description: Retrieve TikTok profile, video, follower, and transcript data.
  - name: LinkedIn
    description: Programmatically fetch LinkedIn company and profile data.
  - name: Search
    description: Search-orientated endpoints spanning web, news, maps, and autocomplete.
  - name: Google
    description: Integrations with Google business listings and location data.
  - name: Scraping
    description: Webpage capture, crawling, and structured content extraction utilities.
  - name: Documents
    description: Document processing, conversion, and metadata utilities.
  - name: AI
    description: DumplingAI agent and knowledge base endpoints.
  - name: Developer Tools
    description: Utilities for executing sandboxed code via API.
paths:
  /api/v1/get-tiktok-transcript:
    post:
      tags:
        - TikTok
      summary: Get TikTok transcript
      description: Retrieve a TikTok video's transcript in the requested language.
      operationId: getTikTokTranscript
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TikTokTranscriptRequest'
      responses:
        '200':
          description: Transcript retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TikTokTranscriptResponse'
        '400':
          description: Invalid request payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
        '404':
          description: Transcript not available for the provided video.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Upstream transcript service returned an error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    TikTokTranscriptRequest:
      type: object
      required:
        - videoUrl
      properties:
        videoUrl:
          type: string
          format: uri
        preferredLanguage:
          type: string
        requestSource:
          $ref: '#/components/schemas/RequestSource'
    TikTokTranscriptResponse:
      type: object
      properties:
        transcript:
          type: string
        language:
          type: string
        id:
          type: string
          nullable: true
        originalUrl:
          type: string
          format: uri
          nullable: true
      additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable description of what went wrong.
      required:
        - error
    RequestSource:
      type: string
      description: Optional identifier describing where the API request originated.
      enum:
        - API
        - WEB
        - MAKE_DOT_COM
        - ZAPIER
        - N8N
        - PLAYGROUND
        - DEFAULT_AUTOMATION
        - AGENT_PREVIEW
        - AGENT_LIVE
        - AUTOPILOT
        - STUDIO
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````