Skip to main content
GET
https://api.scriptbase.app
/
api
/
v1
/
playlists
/
{id}
/
videos
curl "https://api.scriptbase.app/api/v1/playlists/PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf/videos?limit=10" \
  -H "X-API-Key: sk_your_key_here"
{
  "success": true,
  "data": {
    "videos": [
      {
        "id": "W6NZfCO5SIk",
        "title": "JavaScript Tutorial for Beginners",
        "description": "Learn the basics of JavaScript...",
        "thumbnail": "https://i.ytimg.com/vi/W6NZfCO5SIk/maxresdefault.jpg",
        "duration": 3600,
        "position": 0,
        "channel": {
          "id": "UCvjgXvBlF4TVNRWRqJpMKXg",
          "name": "Programming with Mosh"
        },
        "publishedAt": "2018-12-10T00:00:00.000Z"
      },
      {
        "id": "hdI2bqOjy3c",
        "title": "JavaScript Crash Course",
        "description": "Get started with JavaScript in one video...",
        "thumbnail": "https://i.ytimg.com/vi/hdI2bqOjy3c/maxresdefault.jpg",
        "duration": 5400,
        "position": 1,
        "channel": {
          "id": "UC29ju8bIPH5as8OGnQzwJyA",
          "name": "Traversy Media"
        },
        "publishedAt": "2019-01-15T00:00:00.000Z"
      }
    ],
    "pagination": {
      "nextPageToken": "CDIQAA",
      "totalResults": 42
    }
  },
  "meta": {
    "creditsUsed": 2,
    "creditsRemaining": 998,
    "rateLimit": {
      "limit": 60,
      "remaining": 59,
      "resetAt": 1704326400
    }
  }
}

Overview

Retrieve a paginated list of videos from a YouTube playlist.

Authentication

X-API-Key
string
required
Your API key

Path Parameters

id
string
required
YouTube playlist ID (starts with PL) or full playlist URL

Query Parameters

limit
number
default:"30"
Maximum number of videos to return (1-50)
pageToken
string
Token for next page of results

Credits

  • Cost: 2 credits per request

Response

success
boolean
Whether the request was successful
data
object
meta
object
curl "https://api.scriptbase.app/api/v1/playlists/PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf/videos?limit=10" \
  -H "X-API-Key: sk_your_key_here"
{
  "success": true,
  "data": {
    "videos": [
      {
        "id": "W6NZfCO5SIk",
        "title": "JavaScript Tutorial for Beginners",
        "description": "Learn the basics of JavaScript...",
        "thumbnail": "https://i.ytimg.com/vi/W6NZfCO5SIk/maxresdefault.jpg",
        "duration": 3600,
        "position": 0,
        "channel": {
          "id": "UCvjgXvBlF4TVNRWRqJpMKXg",
          "name": "Programming with Mosh"
        },
        "publishedAt": "2018-12-10T00:00:00.000Z"
      },
      {
        "id": "hdI2bqOjy3c",
        "title": "JavaScript Crash Course",
        "description": "Get started with JavaScript in one video...",
        "thumbnail": "https://i.ytimg.com/vi/hdI2bqOjy3c/maxresdefault.jpg",
        "duration": 5400,
        "position": 1,
        "channel": {
          "id": "UC29ju8bIPH5as8OGnQzwJyA",
          "name": "Traversy Media"
        },
        "publishedAt": "2019-01-15T00:00:00.000Z"
      }
    ],
    "pagination": {
      "nextPageToken": "CDIQAA",
      "totalResults": 42
    }
  },
  "meta": {
    "creditsUsed": 2,
    "creditsRemaining": 998,
    "rateLimit": {
      "limit": 60,
      "remaining": 59,
      "resetAt": 1704326400
    }
  }
}

Error Codes

StatusCodeDescription
400INVALID_INPUTInvalid playlist ID or query parameters
401INVALID_API_KEYAPI key is missing or invalid
404NOT_FOUNDPlaylist not found or private
429QUOTA_EXCEEDEDMonthly quota exhausted
429RATE_LIMIT_EXCEEDEDToo many requests
  • Use nextPageToken to paginate through all videos in the playlist.
  • Videos are returned in playlist order.
  • Deleted or private videos in the playlist will be skipped.