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

> Create a batch job to get transcripts of multiple YouTube videos



## OpenAPI

````yaml v1-openapi POST /youtube/transcript/batch
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/batch:
    post:
      description: Create a batch job to get transcripts of multiple YouTube videos
      operationId: postYoutubeTranscriptBatch
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                videoIds:
                  type: array
                  items:
                    type: string
                  description: Array of YouTube video IDs or URLs
                  example:
                    - dQw4w9WgXcQ
                    - https://www.youtube.com/watch?v=xvFZjo5PgG0
                playlistId:
                  type: string
                  description: >-
                    YouTube playlist URL or ID. See [supported URL
                    formats](https://supadata.ai/documentation/youtube/supported-url-formats).
                  examples:
                    - >-
                      https://www.youtube.com/playlist?list=PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc
                    - PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc
                channelId:
                  type: string
                  description: >-
                    YouTube channel URL, handle or ID. See [supported URL
                    formats](https://supadata.ai/documentation/youtube/supported-url-formats).
                  examples:
                    - https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw
                    - https://youtube.com/c/rickastley
                    - UCuAXFkgsw1L7xaCfnd5JJOw
                    - '@rickastley'
                    - rickastley
                limit:
                  type: number
                  minimum: 1
                  maximum: 5000
                  description: >-
                    Maximum number of videos to process (when using playlistId
                    or channelId)
                  example: 20
                  default: 10
                lang:
                  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
                text:
                  type: boolean
                  description: When true, returns plain text transcript.
                  default: false
              oneOf:
                - required:
                    - videoIds
                - required:
                    - playlistId
                - required:
                    - channelId
      responses:
        '200':
          description: Successfully created a batch job
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobId'
        '400':
          description: Invalid Request
          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 transcriptBatch = await supadata.youtube.transcript.batch({
              videoIds: ['dQw4w9WgXcQ', 'xvFZjo5PgG0'],
              // playlistId: 'PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc' // alternatively
              // channelId: 'UC_9-kyTW8ZkZNDHQJ6FgpwQ' // alternatively
              lang: 'en',
              text: true
            });

            console.log(`Started transcript batch job:
            ${transcriptBatch.jobId}`);
        - lang: Python
          label: Python
          source: |-
            from supadata import Supadata, SupadataError

            supadata = Supadata(api_key="YOUR_API_KEY")

            transcript_batch = supadata.youtube.transcript.batch(
                video_ids=["dQw4w9WgXcQ", "xvFZjo5PgG0"],
                # playlist_id="PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc" # alternatively
                # channel_id="UC_9-kyTW8ZkZNDHQJ6FgpwQ" # alternatively
                lang="en",
                text=True
            )
            print(f"Started transcript batch job: {transcript_batch.job_id}")
        - lang: Shell
          label: cURL
          source: |-
            curl -X POST "https://api.supadata.ai/v1/youtube/transcript/batch" \
              -H "x-api-key: YOUR_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "videoIds": ["dQw4w9WgXcQ", "xvFZjo5PgG0"],
                "lang": "en",
                "text": true
              }'
components:
  schemas:
    JobId:
      type: object
      properties:
        jobId:
          type: string
          description: The ID of the job
          example: 123e4567-e89b-12d3-a456-426614174000
      required:
        - jobId
    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
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````