# YouTube Playlist Scraper (Official API) — All Videos & Stats (`actor-forge/youtube-playlist-api`) Actor

Bring your own free YouTube API key. Get every video in one or more YouTube playlists, in playlist order, with views, likes, comments, duration, tags and publish date, plus the playlist title, owner and size, from the official YouTube Data API v3. $0.40 per 1,000 videos.

- **URL**: https://apify.com/actor-forge/youtube-playlist-api.md
- **Developed by:** [ActorForge](https://apify.com/actor-forge) (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.40 / 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 (Official API) — All Videos & Stats

Bring your own free YouTube API key. Get every video in one or more YouTube playlists, in playlist order, with views, likes, comments, duration, tags and publish date, plus the playlist title, owner and size, from the official YouTube Data API v3. $0.40 per 1,000 videos.

**Bring your own free YouTube API key** and get **every video in a YouTube playlist** from the **official YouTube Data API v3**, with no scraping and no blocks. Paste playlist links (or watch links that contain `&list=`), and each video comes back in playlist order with its **position**, **views, likes, comment count**, duration, title, description, tags, category, publish date, channel and thumbnails, plus the **playlist title, owner and size** on every row.

Use it to export a course or tutorial series, audit a music or brand playlist, compare episodes of a series, track the stats of a channel's uploads playlist (UU…), or feed a playlist into Sheets, Notion, Make, n8n or Zapier. Private and deleted entries are skipped and never charged.

**$0.40 per 1,000 videos.** A 200-video playlist costs about 9 of your 10,000 free daily quota units.

#### Get your free API key (about 60 seconds, no billing account)

1. Open the [Google Cloud Console](https://console.cloud.google.com/) and sign in with any Google account. Create a project (top bar → **New project**).
2. Go to **APIs & Services → Library**, search for **YouTube Data API v3** and click **Enable**.
3. Go to **APIs & Services → Credentials → Create credentials → API key** and copy the key (it starts with `AIza`).
4. Paste it into the **YouTube API key** field of this actor and run. The field is a secret input: Apify stores it encrypted, and the actor never logs it or writes it to the output.

You do not need to add a billing account. Each Google Cloud project gets **10,000 free quota units per day**, which reset at midnight Pacific Time. If you restrict the key, allow **YouTube Data API v3** and leave out HTTP-referrer or IP restrictions, because Apify runs on changing server IPs.

#### Official API only, and your data stays yours

- All data comes from the official **YouTube Data API v3** (`https://www.googleapis.com/youtube/v3/`) using **your own key and quota**. Nothing is scraped from youtube.com, and there are no proxies, cookies or logins.
- We never hold, share or pool API keys, and no default key is built in. ActorForge sells the API client; the data is fetched under your key.
- ActorForge keeps no copy of API data after the run. Rows go only to your run's dataset, which belongs to you. YouTube's Developer Policies require stored API data to be **refreshed or deleted at least every 30 days**, so set a retention period on your datasets or re-run to refresh them. Statistics such as view counts change constantly anyway.
- By using this actor you also agree to the [YouTube Terms of Service](https://www.youtube.com/t/terms). Google's handling of API requests is covered by the [Google Privacy Policy](https://policies.google.com/privacy). You can review or revoke your key at any time in the Google Cloud Console, and revoke API access for your Google account at [Google security settings](https://myaccount.google.com/permissions).

*This actor uses YouTube API Services. It is not affiliated with or endorsed by YouTube or Google.*

### What data does it return?

Every run outputs clean, schema-validated rows like these:

| playlistPosition | title | channelTitle | publishedAt | durationSec | viewCount | likeCount | commentCount | playlistTitle |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | Coding Challenge 1: Starfield Simulation | The Coding Train | 2016-04-13T03:17:50Z | 834 | 1389366 | 29579 | 1386 | Coding Challenges |
| 2 | Coding Challenge #2: Menger Sponge Fractal | The Coding Train | 2016-04-18T00:46:47Z | 841 | 323012 | 6390 | 374 | Coding Challenges |
| 3 | Coding Challenge 3: The Snake Game | The Coding Train | 2016-04-20T20:49:48Z | 1647 | 3429714 | 64215 | 3451 | Coding Challenges |
| 4 | Coding Challenge 4: Purple Rain in Processing | The Coding Train | 2016-04-25T15:02:10Z | 734 | 1922986 | 40867 | 2014 | Coding Challenges |

### How much does it cost?

Transparent pay-per-event pricing — you only pay for what you get, and the
actor **always respects your run budget**: set a maximum total charge and it
stops cleanly at the cap instead of overrunning.

| Event | Price | Charged | Worked example |
| --- | --- | --- | --- |
| `video-result` | $0.0004 | per video row delivered (full details and stats) | 1,000 playlist videos = $0.40 (leading playlist scrapers: $0.50-5.00 per 1,000) |
| `apify-actor-start` | $0.00005 | per run per GB of memory (platform start fee) | One run at 256 MB = $0.0000125 |

### Input options

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `apiKey` | string | no | — | Required. Your own free YouTube Data API v3 key (starts with AIza). Get one in about a minute: console.cloud.google.com → create a project → APIs & Services → Library → enable "YouTube Data API v3" → Credentials → Create credentials → API key. No billing account is needed, and the free quota is 10,000 units per day. The key is stored encrypted by Apify, used only for this run's calls to googleapis.com, and never logged or written to the output. |
| `mode` | string | no | `"playlist"` | Always playlist on this listing (every video of each playlist). |
| `playlistUrls` | array | no | — | Playlists to read, one per line: youtube.com/playlist?list=PL… links, watch links that contain \&list=…, or bare playlist IDs (PL…, UU… channel uploads, OLAK5uy\_… albums). Personalised mixes (RD…) are not supported. |
| `maxVideosPerPlaylist` | integer | no | `200` | Videos read from each playlist, in playlist order. Every 50 videos cost about 2 of your 10,000 free daily quota units. |

### Limits & honest notes

- Public and unlisted playlists that the API returns for an API key. Private playlists, Watch Later, Liked videos of other users and personalised mixes (RD…) cannot be read.
- Private and deleted videos inside a playlist are skipped and not charged, so a playlist can return fewer rows than its listed size. Positions keep counting them, so gaps show where they were.
- **You need your own free YouTube Data API v3 key** (see the 4-step guide above). Without one the run finishes at once with a free row of instructions, and nothing is charged.
- Only public data the API returns for an API key: no dislike counts (removed by YouTube), no revenue and no watch time. Like counts hidden by the creator come back as null.
- You must refresh or delete stored API data within 30 days (YouTube Developer Policies III.E.4). We keep nothing after the run.
- The run's spend limit is respected: each page of videos is charged before it is delivered, and the run stops cleanly at the cap. If your key's quota runs out, the run stops cleanly and keeps what was delivered.

### Related ActorForge actors

- [YouTube Scraper (Official API) — Videos, Search & Stats](https://apify.com/actor-forge/youtube-api-scraper) — search, channels and comments with the same key
- [YouTube Channel Scraper (Official API) — All Videos & Stats](https://apify.com/actor-forge/youtube-channel-api) — channel stats plus every upload
- [YouTube Video Details (Official API)](https://apify.com/actor-forge/youtube-video-details-api) — stats for a list of video links

### Changelog

- **2026-10-23** — Initial release: new playlist mode of the YouTube Scraper (official API), playlist order and playlist fields on every row, $0.40 per 1,000 videos.

***

*Built and maintained by **ActorForge**. Reliability first: every actor in the
portfolio is monitored by an automated nightly self-test, and breakages are
typically fixed the same day.*

# Actor input Schema

## `apiKey` (type: `string`):

Required. Your own free YouTube Data API v3 key (starts with AIza). Get one in about a minute: console.cloud.google.com → create a project → APIs & Services → Library → enable "YouTube Data API v3" → Credentials → Create credentials → API key. No billing account is needed, and the free quota is 10,000 units per day. The key is stored encrypted by Apify, used only for this run's calls to googleapis.com, and never logged or written to the output.

## `mode` (type: `string`):

Always playlist on this listing (every video of each playlist).

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

Playlists to read, one per line: youtube.com/playlist?list=PL… links, watch links that contain \&list=…, or bare playlist IDs (PL…, UU… channel uploads, OLAK5uy\_… albums). Personalised mixes (RD…) are not supported.

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

Videos read from each playlist, in playlist order. Every 50 videos cost about 2 of your 10,000 free daily quota units.

## Actor input object example

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

# Actor output Schema

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

One row per playlist video (charged) with its position, playlist title and owner, stats and metadata; free rows of type error for invalid or private playlists.

## `errors` (type: `string`):

Free rows (type error) for invalid, not-found or private inputs and videos with comments disabled.

# 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=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH"
    ],
    "maxVideosPerPlaylist": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("actor-forge/youtube-playlist-api").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=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH"],
    "maxVideosPerPlaylist": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("actor-forge/youtube-playlist-api").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=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH"
  ],
  "maxVideosPerPlaylist": 20
}' |
apify call actor-forge/youtube-playlist-api --silent --output-dataset

```

## MCP server setup

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

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/vmPk6bKUUlaSdaCVs/builds/YMHJBNFBfSPHbvAyg/openapi.json
