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

Get every video of any YouTube playlist, with its title, views, duration and publish date, plus the playlist's own stats: title, description, video count, views. 0.50 USD per 1,000 videos.

- **URL**: https://apify.com/vakitek/youtube-playlist.md
- **Developed by:** [Brahim Sliti](https://apify.com/vakitek) (community)
- **Categories:** Videos, Social media
- **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 video results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

Give it a YouTube playlist, get back every video it contains, in order, with views, duration and publish date. Each row also carries the playlist's own title, description, channel and stats, so you don't need a second actor for them.

### What people use it for

- **Course and tutorial archiving.** Pull every video of a multi-part series in the right order, with durations, to build a table of contents.
- **Competitor research.** Track a brand's "best of" or product playlists to see what they are promoting this month.
- **Content curation.** Export a public playlist you follow into a spreadsheet, with views and dates to sort by.
- **Backup and migration.** Get a clean list of every video id and URL in a playlist before it changes or disappears.

### How to use it

1. Add playlists in **Playlist URLs / ids**, one per line: a playlist URL (`https://www.youtube.com/playlist?list=PL...`), a watch URL with `&list=`, or a bare id (`PL...`, `UU...`, `OL...`).
2. Set **Max videos per playlist** (default 100, up to 5000).
3. Optional: turn on **Add likes, comment count and full description** for one extra request per video.
4. Click **Start**. Export as JSON, CSV or Excel, or pull the results through the API.

```json
{
  "startUrls": ["https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH"],
  "maxVideosPerPlaylist": 250
}
```

### What you get

```json
{
  "id": "17WoOqgXsRM",
  "title": "Coding Challenge #1: The Game of Life",
  "url": "https://www.youtube.com/watch?v=17WoOqgXsRM",
  "thumbnailUrl": "https://i.ytimg.com/vi/17WoOqgXsRM/hq720.jpg",
  "duration": "17:00",
  "durationSeconds": 1020,
  "viewCount": 676000,
  "channelName": "The Coding Train",
  "channelId": "UCvjgXvBlbQiydffZU7m1_aw",
  "playlistIndex": 1,
  "isPlayable": true,
  "playlistInfo": {
    "playlistId": "PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH",
    "playlistTitle": "Coding Challenges",
    "playlistChannelName": "The Coding Train",
    "playlistVideoCount": 246,
    "playlistViewCount": 2719868
  }
}
```

- `playlistIndex` is the video's position in the playlist, starting at 1, with no gaps or duplicates even on a 5,000-video playlist read over several pages.
- `playlistInfo` carries the playlist's own title, description, channel and stats, the same on every row.
- `isPlayable` is `false` for a private or deleted video still listed in the playlist; its other fields stay `null` since YouTube gives nothing else for it.
- Turn on **Add likes, comment count and full description** to also get `likes`, `commentsCount`, `text` (the full description) and `publishedAt` of each video, with `dateIsApproximate` telling you whether that date is the exact one or (rarely, when a single video's own page could not be fetched) the same approximate one as without the option. Without the option, those five fields are left out, not guessed.

### Pricing

**0.50 USD per 1,000 videos.** Likes, comment count and description are included at no extra cost when you turn them on.

There is no minimum charge per run: one playlist with 50 videos costs 0.025 USD. Error rows are free, and there's no monthly fee or Apify platform usage on top.

Example: 250 videos from one playlist costs 0.125 USD.

### Good to know

- A mix or "radio" playlist (an id starting with `RD`) is not a regular playlist: it comes back as an `UNSUPPORTED_PLAYLIST` error row, free.
- This actor only scrapes playlists. For a channel's own uploads, Shorts or streams, use our [YouTube Channel Scraper](https://apify.com/vakitek/youtube-channel-videos). For captions, use our [YouTube Transcript Scraper](https://apify.com/vakitek/youtube-transcript).
- Without **Add likes, comment count and full description**, dates come from the playlist listing itself and can be approximate ("2 months ago"); turn the option on for the exact publish date.
- You don't need a proxy, a YouTube account or a YouTube API key.

### Use it from n8n, Make or an API

- **Small inputs**: call `run-sync-get-dataset-items` and read the items back directly. Set **Time budget (seconds)** (default 240) to how long you are willing to wait: the actor stops picking up new pages before that point and returns what it already has, so you never hit Apify's 300 second run-sync limit and lose the whole run.
- **Big inputs**: start the run with `POST /v2/acts/vakitek~youtube-playlist/runs`, poll `GET /v2/actor-runs/<runId>` (or add `waitForFinish=60`) until the status is `SUCCEEDED`, then read `GET /v2/datasets/<datasetId>/items`. Set **Time budget (seconds)** to `0` (no limit) for this pattern.

### Errors

A bad input never crashes the run. It becomes a row with an `error` code, and you are not charged for it.

| `error` | What happened | Retry? |
| --- | --- | --- |
| `NOT_FOUND` | The playlist URL or id doesn't match a real playlist | No |
| `UNSUPPORTED_PLAYLIST` | The id is a mix/radio playlist or another auto-generated type YouTube does not let anyone browse | No |
| `NO_RESULTS` | The playlist exists but has no videos | No |
| `INVALID_INPUT` | An input value is invalid | No |
| `BLOCKED` | YouTube refused us for now, even after trying every proxy tier | Yes |
| `UPSTREAM_ERROR` | Something went wrong on YouTube's side or ours | Yes |
| `UPSTREAM_UNAVAILABLE` | Our API was unreachable | Yes |
| `TIME_BUDGET_EXCEEDED` | The time budget ran out before this playlist finished | Yes |

### FAQ

**How many videos can I get from one playlist?**
Up to 5000. Set **Max videos per playlist** as high as you need.

**I already use another YouTube playlist actor. Do I have to change my code?**
Probably not. The output field names (`playlistIndex`, `playlistInfo`, `viewCount`...) follow the most used playlist scrapers on the Store.

**Can I call it from my code or from an AI agent?**
Yes, like any Apify actor: REST API, the Python and JavaScript clients, or the Apify MCP server. The examples are in the API tab.

**Something broke or a field is missing?**
Open an issue on this page. We read every one and usually answer within a day.

# Changelog

This Actor's version history is a separate document: https://apify.com/vakitek/youtube-playlist/changelog.md

# Actor input Schema

## `startUrls` (type: `array`):

YouTube playlist URLs (e.g. https://www.youtube.com/playlist?list=PL...), watch URLs with a list= parameter, or bare playlist ids (PL..., UU..., OL...).

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

Maximum number of videos to scrape per playlist.

## `includeVideoDetails` (type: `boolean`):

Adds likes, comment count, full description and the exact publish date to each video via one extra request per video. Comment count is null with commentsTurnedOff set to true when the creator disabled comments.

## `language` (type: `string`):

Interface language (hl) requested from YouTube, as an ISO 639-1 code (e.g. fr, de, ja). Controls which language translated titles/descriptions come back in.

## `country` (type: `string`):

Geolocation (gl) requested from YouTube, as an ISO 3166-1 alpha-2 code (e.g. FR, DE, JP).

## `timeBudgetSecs` (type: `integer`):

Stop and return what is ready after this many seconds, so n8n/Make run-sync calls never time out. 0 = no limit.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH"
  ],
  "maxVideosPerPlaylist": 100,
  "includeVideoDetails": false,
  "language": "en",
  "country": "US",
  "timeBudgetSecs": 240
}
```

# Actor output Schema

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

Every video of the playlist, in playlist order, with the playlist's own stats attached to each row. Error items carry an `error` code and the `input` that failed.

# 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 = {
    "startUrls": [
        "https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("vakitek/youtube-playlist").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 = { "startUrls": ["https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH"] }

# Run the Actor and wait for it to finish
run = client.actor("vakitek/youtube-playlist").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 '{
  "startUrls": [
    "https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH"
  ]
}' |
apify call vakitek/youtube-playlist --silent --output-dataset

```

## MCP server setup

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

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/0j2NBxZrvxbIYaQiJ/builds/qrM9jRLa4enkbsfr3/openapi.json
