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

# Playlist Videos

> Get video IDs from a YouTube playlist.



## OpenAPI

````yaml v1-openapi GET /youtube/playlist/videos
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/playlist/videos:
    get:
      description: Get video IDs from a YouTube playlist.
      operationId: getYoutubePlaylistVideos
      parameters:
        - in: query
          name: id
          schema:
            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
          required: true
        - in: query
          name: limit
          schema:
            type: number
            minimum: 1
            maximum: 5000
            default: 100
            description: Maximum number of video IDs to return
            example: 10
          required: false
      responses:
        '200':
          description: Successfully fetched playlist video IDs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoIds'
        '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 videos = await supadata.youtube.playlist.videos({
              id: 'https://www.youtube.com/playlist?list=PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc', // can be id or url
              limit: 20, // Optional: limit the number of videos to fetch
            });
            console.log(`Found ${videos.videoIds.length} videos`);
        - lang: Python
          label: Python
          source: |-
            from supadata import Supadata

            supadata = Supadata(api_key="YOUR_API_KEY")
            videos = supadata.youtube.playlist.videos(
                id="https://www.youtube.com/playlist?list=PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc", # can be id or url
                limit=20  # Optional: limit the number of videos to fetch
            )
            print(f"Found {len(videos.video_ids)} videos")
            print(videos.video_ids)
        - lang: Shell
          label: cURL
          source: >-
            curl -X GET
            "https://api.supadata.ai/v1/youtube/playlist/videos?id=https://www.youtube.com/playlist?list=PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc&limit=20"
            \
              -H "x-api-key: YOUR_API_KEY" \
              -H "Content-Type: application/json"
components:
  schemas:
    VideoIds:
      type: object
      properties:
        videoIds:
          type: array
          items:
            type: string
          description: List of vertical video IDs
          example:
            - dQw4w9WgXcQ
            - xvFZjo5PgG0
        shortIds:
          type: array
          items:
            type: string
          description: List of Shorts IDs
          example:
            - dQw4w9WgXcQ
            - xvFZjo5PgG0
        liveIds:
          type: array
          items:
            type: string
          description: List of live video IDs
          example:
            - dQw4w9WgXcQ
            - xvFZjo5PgG0
      required:
        - videoIds
        - shortIds
        - liveIds
    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

````