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

# Video Batch

> Create a batch job to fetch metadata of multiple YouTube videos



## OpenAPI

````yaml v1-openapi POST /youtube/video/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/video/batch:
    post:
      description: Create a batch job to fetch metadata of multiple YouTube videos
      operationId: postYoutubeVideoBatch
      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
              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'
        '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 batchJob = await supadata.youtube.video.batch({
              videoIds: ['dQw4w9WgXcQ', 'xvFZjo5PgG0', 'L_jWHffIx5E']
              // playlistId: 'PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc' // alternatively
              // channelId: 'UC_9-kyTW8ZkZNDHQJ6FgpwQ' // alternatively
            });
            console.log(`Started batch job: ${batchJob.jobId}`);
        - lang: Python
          label: Python
          source: |-
            from supadata import Supadata, SupadataError

            supadata = Supadata(api_key="YOUR_API_KEY")

            batch_job = supadata.youtube.video.batch(
                video_ids=["dQw4w9WgXcQ", "xvFZjo5PgG0", "L_jWHffIx5E"]
                # playlist_id="PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc" # alternatively
                # channel_id="UC_9-kyTW8ZkZNDHQJ6FgpwQ" # alternatively
            )
            print(f"Started batch job: {batch_job.job_id}")
        - lang: Shell
          label: cURL
          source: |-
            curl -X POST "https://api.supadata.ai/v1/youtube/video/batch" \
              -H "x-api-key: YOUR_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "videoIds": ["dQw4w9WgXcQ", "xvFZjo5PgG0"]
              }'
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

````