# YouTube Playlist Scraper (`serentity/youtube-playlist-scraper`) Actor

List every video in a YouTube playlist by URL or ID: title, channel, duration, position and thumbnail, plus the playlist title, owner, video count and view count. Handles playlists of any size. No API key, no quota.

- **URL**: https://apify.com/serentity/youtube-playlist-scraper.md
- **Developed by:** [Tarik Cerkezovic](https://apify.com/serentity) (community)
- **Categories:** Videos, Developer tools, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 playlist videos

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## YouTube Playlist Scraper

Every video in a YouTube playlist, from a playlist URL or ID, as one item per video: title, channel, duration, position and thumbnail, with the playlist's title, owner, description, video count, view count and last-updated date repeated on each item. Works for playlists of any size (hundreds of videos page through automatically), for podcasts, courses, albums, uploads playlists (UU...) and unlisted playlists you have the link to.

No YouTube API key, no quota, no login. Built for archiving course or podcast playlists, feeding video IDs into transcript or details actors, and tracking playlist changes over time.

### What you get

| Field | Description |
|---|---|
| `videoId`, `url`, `title` | The video |
| `position`, `index` | Position among returned videos, and YouTube's own index in the playlist |
| `channelName`, `channelId`, `channelUrl` | Who published the video |
| `durationSeconds`, `durationText`, `thumbnailUrl`, `isAvailable` | Length, thumbnail, and whether the video is still playable |
| `playlistId`, `playlistUrl`, `playlistTitle`, `playlistDescription`, `playlistType` | The playlist |
| `ownerName`, `ownerChannelId`, `ownerUrl` | The playlist owner |
| `videoCount`, `playlistViewCount`, `lastUpdatedText`, `isUnlisted` | Playlist stats |
| `error`, `errorMessage` | Only on playlist-level failures |

### Sample output

```json
{
  "videoId": "ZAzWPE9CItg",
  "url": "https://www.youtube.com/watch?v=ZAzWPE9CItg",
  "title": "AI Crisis in Math: Navier-Stokes, Riemann Hypothesis & Complexity Theory | Lex Fridman Podcast #503",
  "position": 1,
  "index": 1,
  "channelName": "Lex Fridman",
  "channelId": "UCSHZKyawb77ixDdsGog4iWA",
  "channelUrl": "https://www.youtube.com/@lexfridman",
  "durationSeconds": 12867,
  "durationText": "3:34:27",
  "thumbnailUrl": "https://i.ytimg.com/vi/ZAzWPE9CItg/hqdefault.jpg",
  "isAvailable": true,
  "playlistId": "PLrAXtmErZgOdP_8GztsuKi9nrraNbKKp4",
  "playlistUrl": "https://www.youtube.com/playlist?list=PLrAXtmErZgOdP_8GztsuKi9nrraNbKKp4",
  "playlistTitle": "Lex Fridman Podcast",
  "playlistType": "Podcast",
  "ownerName": "Lex Fridman",
  "videoCount": 448,
  "playlistViewCount": 5049988,
  "lastUpdatedText": "Last updated on Oct 26, 2026",
  "input": "PLrAXtmErZgOdP_8GztsuKi9nrraNbKKp4",
  "fetchedAt": "2026-11-05T17:20:00.000Z"
}
```

### Input

| Field | Type | Default | What it does |
|---|---|---|---|
| `playlistUrls` | array of strings | required | Playlist URLs, watch URLs with a `list` parameter, or bare playlist IDs. |
| `maxVideosPerPlaylist` | integer | `0` (all) | Cap per playlist. |
| `includeUnavailable` | boolean | `false` | Return entries YouTube still lists but marks as private or deleted, with `isAvailable` false. Entries YouTube hides entirely cannot be returned. |
| `maxConcurrency` | integer | `3` | Playlists in parallel. |
| `proxyConfiguration` | object | Apify datacenter proxy | Proxy for all requests. |
| `residentialFallback` | boolean | `true` | Retry a blocked playlist through residential proxies, only on a detected block. |

Minimal input:

```json
{ "playlistUrls": ["https://www.youtube.com/playlist?list=PLrAXtmErZgOdP_8GztsuKi9nrraNbKKp4"] }
```

### Errors

| `error` | Meaning | Charged? |
|---|---|---|
| `INVALID_INPUT` | Not a playlist URL or ID | no |
| `PLAYLIST_NOT_FOUND` | The playlist does not exist or is private | no |
| `NO_VIDEOS` | The playlist has no available videos | no |
| `BLOCKED` | YouTube refused the request from every proxy tried | no |
| `FETCH_FAILED` | Network or parsing failure | no |

### Pricing

Pay per event: a small fixed amount per video item, plus Apify platform usage. Error items are free. YouTube serves 200 playlist entries per request, so even a 1,000-video playlist is a handful of requests.

### Notes

- View counts and publish dates per video are not part of YouTube's playlist listing. Pass the video IDs to the YouTube Video Details Scraper from the same author to get them.
- Mixes (playlist IDs starting with RD) are endless by design; the actor returns their first page only.
- `index` follows YouTube's numbering, so it keeps counting over hidden private or deleted entries; `position` counts only what was returned.

### Using it from code

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('serentity/youtube-playlist-scraper').call({ playlistUrls: ['PLrAXtmErZgOdP_8GztsuKi9nrraNbKKp4'] });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((v) => v.videoId));
```

### Legal

The data is what YouTube shows to any visitor of a public or unlisted playlist page. No login, no personal data beyond public channel names. Use it in line with YouTube's terms of service.

# Actor input Schema

## `playlistUrls` (type: `array`):

Playlist URLs (https://www.youtube.com/playlist?list=PL...), watch URLs that carry a list parameter, or bare playlist IDs (PL..., UU..., OL...).

## `maxVideosPerPlaylist` (type: `integer`):

Stop after this many videos per playlist. 0 means all.

## `includeUnavailable` (type: `boolean`):

Playlists can contain videos that are now private or deleted. Off skips them; on returns the ones YouTube still lists, with isAvailable false and the placeholder title.

## `maxConcurrency` (type: `integer`):

Playlists processed in parallel.

## `proxyConfiguration` (type: `object`):

Proxy used for the requests. Apify datacenter proxies are used by default.

## `residentialFallback` (type: `boolean`):

If YouTube blocks the datacenter proxy for a playlist, retry through Apify residential proxies. Only used on a detected block.

## Actor input object example

```json
{
  "playlistUrls": [
    "https://www.youtube.com/playlist?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf"
  ],
  "maxVideosPerPlaylist": 0,
  "includeUnavailable": false,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "residentialFallback": true
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "playlistUrls": [
        "https://www.youtube.com/playlist?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("serentity/youtube-playlist-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "playlistUrls": ["https://www.youtube.com/playlist?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("serentity/youtube-playlist-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "playlistUrls": [
    "https://www.youtube.com/playlist?list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call serentity/youtube-playlist-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,serentity/youtube-playlist-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Px5JLMHSuzmRXXfYJ/builds/DWPWCQPrt3iHWxtSn/openapi.json
