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

# Transcript

> Get transcript from a supported video platform (YouTube, TikTok, Twitter, Instagram, Facebook) or file URL. If the video is too large to return transcript immediately, request returns a job ID. Use the `/transcript/:jobId` endpoint to get job results.



## OpenAPI

````yaml v1-openapi GET /transcript
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:
  /transcript:
    get:
      description: >-
        Get transcript from a supported video platform (YouTube, TikTok,
        Twitter, Instagram, Facebook) or file URL. If the video is too large to
        return transcript immediately, request returns a job ID. Use the
        `/transcript/:jobId` endpoint to get job results.
      operationId: getTranscript
      parameters:
        - in: query
          name: url
          schema:
            type: string
            format: uri
            description: >-
              Video URL from any supported platform (YouTube, TikTok, Twitter,
              Instagram) or a file URL.
            example: https://youtu.be/dQw4w9WgXcQ
          required: true
        - in: query
          name: lang
          schema:
            type: string
            description: >-
              Preferred language code of the transcript (ISO 639-1). If not
              provided, the first available language will be returned. If the
              requested language is unavailable, the API defaults to the first
              available language. See
              [Languages](https://supadata.ai/documentation/youtube/supported-language-codes).
            example: en
          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: mode
          schema:
            type: string
            enum:
              - native
              - auto
              - generate
            default: auto
            description: >-
              Transcript mode: `native` (only fetch existing transcript),
              `generate` (always generate transcript using AI), or `auto` (try
              native, fallback to generate if unavailable). If url is a file
              URL, mode is always `generate`.
            example: auto
          required: false
      responses:
        '200':
          description: Successfully fetched or generated transcript
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranscriptOrJobId'
        '202':
          description: Job ID for asynchronous processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranscriptOrJobId'
        '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',
            });

            // Get transcript or job ID
            const transcriptResult = await supadata.transcript({
              url: 'https://youtu.be/dQw4w9WgXcQ',
              lang: 'en',
              text: true,
              mode: 'auto' // 'native', 'auto', or 'generate'
            });
            console.log(transcript);

            if ('jobId' in transcriptJob) {
              // Check job result
              const result = await supadata.transcript.getJobStatus(transcriptJob.jobId);
              console.log(result);
            }
        - lang: Python
          label: Python
          source: |-
            from supadata import Supadata

            supadata = Supadata(api_key="YOUR_API_KEY")

            # Get transcript or job ID
            transcript_result = supadata.transcript(
                url="https://youtu.be/dQw4w9WgXcQ",
                lang="en",
                text=True,
                mode="auto"  # 'native', 'auto', or 'generate'
            )
            print(f"Got transcript result or job ID: {transcript_result}")

            if hasattr(transcript_result, 'job_id'):
                # Check job result
                result = supadata.transcript.get_job_status(transcript_result.job_id)
                print(f"Job status: {result.status}")
                if result.status == "completed":
                    print(result.content)
        - lang: Shell
          label: cURL - Get Transcript
          source: >-
            curl -X GET
            "https://api.supadata.ai/v1/transcript?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ&lang=en&text=true&mode=auto"
            \
              -H "x-api-key: YOUR_API_KEY" \
              -H "Content-Type: application/json"
        - lang: Shell
          label: cURL - Get Job Status
          source: |-
            curl -X GET "https://api.supadata.ai/v1/transcript/JOB_ID" \
              -H "x-api-key: YOUR_API_KEY" \
              -H "Content-Type: application/json"
components:
  schemas:
    TranscriptOrJobId:
      anyOf:
        - $ref: '#/components/schemas/Transcript'
        - $ref: '#/components/schemas/JobId'
      description: Either a transcript result (synchronous) or a job ID (asynchronous).
    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
    Transcript:
      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: Never gonna give you up, never gonna let you down...
        lang:
          type: string
          description: ISO 639-1 language code of transcript
          example: en
        availableLangs:
          type: array
          items:
            type: string
          description: List of available language codes
          example:
            - en
            - es
            - zh-TW
      required:
        - content
        - lang
        - availableLangs
    JobId:
      type: object
      properties:
        jobId:
          type: string
          description: The ID of the job
          example: 123e4567-e89b-12d3-a456-426614174000
      required:
        - jobId
    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

````