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

# Translate Transcript

> Translate YouTube video transcript into different languages.



## OpenAPI

````yaml v1-openapi GET /youtube/transcript/translate
openapi: 3.1.0
info:
  title: Supadata
  description: Web & Social Media Content API for Developers
  version: 1.3.0
servers:
  - url: https://api.supadata.ai/v1
security:
  - apiKeyAuth: []
paths:
  /youtube/transcript/translate:
    get:
      description: Translate YouTube video transcript into different languages.
      operationId: getYoutubeTranscriptTranslate
      parameters:
        - in: query
          name: url
          schema:
            type: string
            format: uri
            description: >-
              YouTube video URL. See [supported URL
              formats](https://supadata.ai/documentation/youtube/supported-url-formats).
            example: https://youtu.be/dQw4w9WgXcQ
          required: false
        - in: query
          name: videoId
          schema:
            type: string
            description: YouTube video ID. Alternative to URL.
            example: dQw4w9WgXcQ
          required: false
        - in: query
          name: text
          schema:
            type: boolean
            description: When true, returns plain text transcript.
            default: false
          required: false
        - in: query
          name: chunkSize
          schema:
            type: number
            minimum: 50
            maximum: 10000
            description: Maximum characters per transcript chunk (only when text=false)
            example: 1000
          required: false
        - in: query
          name: lang
          schema:
            type: string
            description: >-
              Language code for translation (ISO 639-1). See
              [Languages](https://supadata.ai/documentation/youtube/supported-language-codes).
            example: en
          required: true
      responses:
        '200':
          description: Successfully translated transcript
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranslatedTranscript'
        '206':
          description: Transcript Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '400':
          description: Invalid Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: TypeScript
          label: Node.js
          source: |-
            import { Supadata } from '@supadata/js';

            const supadata = new Supadata({
              apiKey: 'YOUR_API_KEY',
            });
            const translated = await supadata.youtube.translate({
              url: 'https://youtu.be/dQw4w9WgXcQ',
              lang: 'es',
              text: false,
            });
            console.log(translated);
        - lang: Python
          label: Python
          source: |-
            from supadata import Supadata

            supadata = Supadata(api_key="YOUR_API_KEY")
            translated = supadata.youtube.translate(
                url="https://youtu.be/dQw4w9WgXcQ",
                lang="es",
                text=False
            )
            print(f"Got translated transcript in {translated.lang}")
        - lang: Shell
          label: cURL
          source: >-
            curl -X GET
            "https://api.supadata.ai/v1/youtube/transcript/translate?url=https://youtu.be/dQw4w9WgXcQ&lang=es"
            \
              -H "x-api-key: YOUR_API_KEY" \
              -H "Content-Type: application/json"
components:
  schemas:
    TranslatedTranscript:
      type: object
      properties:
        content:
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/TranscriptChunk'
            - type: string
              description: Plain text transcript when text=true parameter is used
              example: Nunca voy a abandonarte, nunca voy a decepcionarte…
        lang:
          type: string
          description: ISO 639-1 language code of translation
          example: es
      required:
        - content
        - lang
    Error:
      type: object
      properties:
        error:
          type: string
          enum:
            - invalid-request
            - internal-error
            - forbidden
            - unauthorized
            - upgrade-required
            - transcript-unavailable
            - not-found
            - limit-exceeded
          description: Error code identifying the type of error
          example: invalid-request
        message:
          type: string
          description: Human readable error message
          example: Invalid Request
        details:
          type: string
          description: Detailed error description
          example: The request is invalid or malformed
        documentationUrl:
          type: string
          description: URL to error documentation
          example: https://supadata.ai/documentation/errors#invalid-request
      required:
        - error
        - message
        - details
      description: Standard error response format
    TranscriptChunk:
      type: object
      properties:
        text:
          type: string
          description: Transcript segment
          example: Never gonna give you up...
        offset:
          type: number
          description: Start time in milliseconds
          example: 8150
        duration:
          type: number
          description: Duration in milliseconds
          example: 1200
        lang:
          type: string
          description: ISO 639-1 language code of chunk
          example: en
      required:
        - text
        - offset
        - duration
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````