# YouTube Playlist Scraper 📺 (videos, views, durations) (`tagadanar/youtube-playlist-scraper`) Actor

Paste YouTube playlist links or IDs: one row per video (position, title, channel, duration, views, thumbnails) plus a playlist row with its owner, video count and last update. Optional video details: exact views, likes, comments, publish date. First 100 videos per playlist. No API key.

- **URL**: https://apify.com/tagadanar/youtube-playlist-scraper.md
- **Developed by:** [Tagada Data](https://apify.com/tagadanar) (community)
- **Categories:** Videos, Social media, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 1,000 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: videos, views, durations, channels

Paste YouTube playlist links or IDs and get **one flat row per video**: its position in the playlist, video ID and
link, title, channel (name, ID, @handle), duration, views, how long ago it was published and every thumbnail size,
plus **one row per playlist** with its title, description, owner, video count, total views and last update.
Turn on **video details** to add exact views, likes, comment count, publish date, description, hashtags and the
channel's subscribers for each video.

**$0.50 per 1,000 videos on Free ($0.35 on Gold), plus $0.001 per run. Video details: +$0.50 per 1,000 videos
($0.35 on Gold). Platform usage is included.** No API key, no login, no proxy needed.

**Up to the first 100 videos of each playlist.** YouTube's public playlist page lists the first 100 videos; the rest
only load through YouTube's internal API, which its robots.txt closes to crawlers, and this actor does not use it.
For a longer playlist the playlist row says so plainly: `videosTotal` (what YouTube counts), `videosRead` (what
you got) and `truncated: true`.

### What you get

Video rows (`type: "video"`), one per video, in playlist order. Fields YouTube does not show are null.

| Field | What it is |
| --- | --- |
| `type` | `video` |
| `playlistId` | The playlist the row came from |
| `playlistTitle` | Its title |
| `position` | 1-based position in the playlist |
| `videoId` | The 11-character video ID |
| `url` | Watch link inside the playlist |
| `title` | Video title |
| `channelName` | The video's channel (the first one on a collaboration) |
| `channelId` | Channel ID (`UC…`), null on a collaboration row YouTube shows without a link |
| `channelHandle` | `@handle` when YouTube shows it |
| `channelUrl` | Channel link |
| `collaborators` | Other channels named on a collaboration, else null |
| `durationText` | `9:52`, as shown |
| `durationSeconds` | Duration in seconds |
| `viewCountText` | Views as shown (`13M`) |
| `viewCountApprox` | Views as a number, rounded the way YouTube rounds them (13,000,000) |
| `publishedText` | `10 years ago`, as shown |
| `isShort` | A Short |
| `isLive` | Live right now |
| `isUpcoming` | A scheduled premiere or stream |
| `thumbnailUrl` | Largest thumbnail |
| `thumbnails` | Every thumbnail size (url, width, height) |
| `detailsStatus` | With video details on: `ok`, `unavailable`, `failed`, `charge-limit` or `clock-stopped`; else null |
| `viewCount` | Video details: exact views |
| `likeCount` | Video details: likes |
| `commentCountApprox` | Video details: comment count (YouTube rounds it, 4K) |
| `publishDate` | Video details: publish date (YYYY-MM-DD) |
| `uploadDate` | Video details: upload date (YYYY-MM-DD), when the page carries it (often missing) |
| `category` | Video details: YouTube category (Education, Music…), when the page carries it (often missing) |
| `description` | Video details: full description |
| `tags` | Video details: the uploader's tags, when the page carries them (often missing) |
| `hashtags` | Video details: hashtags in the title area and description |
| `channelSubscriberCountApprox` | Video details: the channel's subscribers (rounded) |
| `retrievedAt` | When the row was read (ISO 8601) |

Playlist rows (`type: "playlist"`), one per playlist, free:

| Field | What it is |
| --- | --- |
| `status` | `ok`, `empty`, `not-found`, `unviewable`, `charge-limit` or `unreadable` |
| `statusReason` | YouTube's own words when it refused (`The playlist does not exist.`) |
| `title` | Playlist title |
| `description` | Playlist description |
| `channelName` | Owner channel |
| `videosTotal` | How many videos YouTube counts in the playlist |
| `videosOnPage` | How many the public page listed |
| `videosRead` | How many video rows you got from it |
| `truncated` | true when the playlist holds more videos than the page lists |
| `viewCount` | Total playlist views |
| `lastUpdated` | Last update (YYYY-MM-DD; "Updated 3 days ago" is converted from the read date) |
| `isUnlisted` | An unlisted playlist |
| `hiddenUnavailableVideos` | Private or deleted videos YouTube hides from the list, when it says how many |

Example video row (trimmed):

```json
{
  "type": "video",
  "playlistId": "PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab",
  "playlistTitle": "Essence of linear algebra",
  "position": 1,
  "videoId": "fNk_zzaMoSs",
  "url": "https://www.youtube.com/watch?v=fNk_zzaMoSs&list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab",
  "title": "Vectors | Chapter 1, Essence of linear algebra",
  "channelName": "3Blue1Brown",
  "channelId": "UCYO_jab_esuFRV4b17AJtAw",
  "channelHandle": "@3blue1brown",
  "durationText": "9:52",
  "durationSeconds": 592,
  "viewCountText": "13M",
  "viewCountApprox": 13000000,
  "publishedText": "10 years ago",
  "isShort": false,
  "detailsStatus": "ok",
  "viewCount": 13118063,
  "likeCount": 242756,
  "commentCountApprox": 4000,
  "publishDate": "2016-08-05"
}
```

### Who uses it

- **Course and content curators**: export a course playlist with durations to plan watch time or build a syllabus.
- **Music and marketing teams**: track the views of every video in a chart or campaign playlist, run after run.
- **Researchers and data teams**: turn playlists into a table of video IDs to feed transcript, comment or
  analytics tools.
- **Channel owners and agencies**: audit a channel's playlists (title, count, last update) and the videos in them.

### Examples

Prefill: one playlist, every video on its page.

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

Several playlists, the first 20 videos of each, with video details:

```json
{"playlists":["PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab","https://www.youtube.com/watch?v=0VH1Lim8gL8&list=PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf"],"maxVideosPerPlaylist":20,"includeVideoDetails":true}
```

A channel's recent uploads: its uploads playlist is its channel ID with `UC` replaced by `UU`
(`UCBJycsmduvYEL83R_U4JriQ` -> `UUBJycsmduvYEL83R_U4JriQ`), and `UUSH…` lists its Shorts.

```json
{"playlists":["UUBJycsmduvYEL83R_U4JriQ"],"maxVideosPerPlaylist":50}
```

### Results, zeros and errors

- A playlist that does not exist, a mix (`RD…`) or another list YouTube will not show publicly gets a free playlist row
  with YouTube's reason, and costs nothing.
- An empty playlist is reported as empty (YouTube's own count says 0).
- A playlist YouTube refused, or the run clock stopped, is named in the run status and is never reported as empty.
- Personal lists (Watch later `WL`, Liked `LL`) and links that are not YouTube playlists are skipped and named in the
  status. A run with nothing usable ends at once with an "Input error: ..." message and only the $0.001 start charge.
- With video details on, a video whose page could not be read still gets its row, without details, and its details
  are not charged.

**Speed.** Without details a playlist takes about a second. Video details open one page per video, about 1.5
seconds per video. YouTube limits how many video pages one address may open in a few minutes: when it answers
"too many requests" the actor slows down and retries, and if YouTube keeps refusing it stops asking and delivers the
remaining rows without details (not charged for them). For details on many hundreds of videos, split the work
across runs.

### Pricing

- $0.001 per run (start).
- $0.50 per 1,000 videos on Free, with lower prices on higher Apify plans ($0.35 per 1,000 on Gold).
- Video details add-on: $0.50 per 1,000 videos that got their details ($0.35 on Gold).
- Playlist rows are free. Platform usage is included.

Set a maximum charge per run in Apify if you want a hard ceiling; the actor stops at it and says so in the status.

### FAQ

**Can it read all videos of a playlist longer than 100?** No. The public playlist page lists the first 100; the rest
load only through YouTube's internal API, which YouTube's robots.txt closes to crawlers. The playlist row tells you
the full count and marks the read as truncated.

**Why are views rounded?** The playlist page shows "13M". Turn on video details for the exact count from each
video's page.

**Does it need a YouTube API key or quota?** No.

**Are the videos in playlist order?** Yes: `position` is the order on the playlist page.

### Data use

Reads public YouTube pages only (the playlist page and, with details, each video's watch page), as a logged-out
visitor. YouTube's Terms of Service restrict automated access; you are responsible for how you use the data.
Rows hold public channel and video information, no viewer or commenter data.

# Changelog

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

# Actor input Schema

## `playlists` (type: `array`):

Playlist URLs or IDs, one per line: https://www.youtube.com/playlist?list=PL..., a watch URL with \&list=..., or the bare ID (PL..., UU..., OLAK5uy\_...). Up to 200 per run. Mixes (RD...) and personal lists (Watch later, Liked) are not public and cannot be read.

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

Cap per playlist, from 1 to 100. The public playlist page lists the first 100 videos; for a longer playlist the playlist row says how many it holds (videosTotal) and that the read was cut (truncated).

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

Open each video's public page for exact views, likes, comment count, publish date, description, hashtags and the channel's subscribers. Slower (about 1.5 seconds per video) and charged per video that got its details.

## Actor input object example

```json
{
  "playlists": [
    "https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab"
  ],
  "maxVideosPerPlaylist": 100,
  "includeVideoDetails": false
}
```

# Actor output Schema

## `videos` (type: `string`):

No description

## `playlists` (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 = {
    "playlists": [
        "https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab"
    ]
};

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tagadanar/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/6Pd6ga0M5729KiUyX/builds/3H7p6TobLN6V5pVDy/openapi.json
