# YouTube Playlist Export (Data API), No Login (`cliqtomedia/youtube-playlist-export`) Actor

Export every video of a YouTube playlist to CSV, Excel or JSON: position, title, channel, date, duration, views and likes. Up to 20,000 videos per playlist. Official Data API with your own free key. No login.

- **URL**: https://apify.com/cliqtomedia/youtube-playlist-export.md
- **Developed by:** [Cliqto Media](https://apify.com/cliqtomedia) (community)
- **Categories:** Videos, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.21 / 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 Export turns public YouTube playlists into a table: one row per playlist position, with the video title, channel, publish date, duration, views, likes, comments and link. You paste playlist links or IDs and add your own free YouTube Data API v3 key, and you get the whole playlist in the same order as on YouTube. The price is $0.30 per 1,000 videos on the Free plan.

The Actor uses only the official [YouTube Data API v3](https://developers.google.com/youtube/v3/docs/playlistItems/list): no login, no cookies, no proxy and no page scraping. **You need an API key.** Without a key the run returns one `api_key_required` row and stops. Getting a key is free and takes about 5 minutes ([how](#get-your-api-key)).

![YouTube Playlist Export: paste a playlist link and your API key, get one row per playlist position with title, duration, views and publish date. Private videos keep their position and are marked unavailable. Official Data API, up to 20,000 videos per playlist.](https://api.apify.com/v2/key-value-stores/GnggUxqE31xnWfn3h/records/HERO-v2)

### Table of contents

- [What it does](#what-it-does)
- [Get your API key](#get-your-api-key)
- [Quick start](#quick-start)
- [Input](#input)
- [Input examples](#input-examples)
- [Output example](#output-example)
- [Output fields](#output-fields)
- [Pricing and cost examples](#pricing-and-cost-examples)
- [Use cases](#use-cases)
- [API, export and AI agents](#api-export-and-ai-agents)
- [Limits and partial results](#limits-and-partial-results)
- [Troubleshooting](#troubleshooting)
- [FAQ](#faq)
- [Related Actors](#related-actors)
- [Support](#support)

### What it does

You give one or more playlists. For each playlist the Actor reads the playlist name and owner, then walks the playlist 50 entries at a time and saves one row per entry:

- `position` is the place in the playlist, starting at 1, exactly as in the YouTube player.
- A private or deleted video keeps its position. Its row has status `unavailable` and `unavailableReason` (`private` or `deleted`), so there are no holes and no renumbering.
- With **Include duration and view/like/comment counts** on (the default), each row also has `durationSec`, `views`, `likes` and `comments`.
- `null` means "no value from YouTube" (for example, hidden likes). It is never written as `0`.
- Accepted inputs: `youtube.com/playlist?list=…`, a watch link with `&list=…`, `youtu.be/…?list=…`, `music.youtube.com` playlist links, `m.youtube.com` links, or bare playlist IDs (`PL…`, `UU…`, `OL…` and others). The same playlist given twice is exported once.
- A channel's uploads playlist works too: take the channel ID `UC…` and change the first two letters to `UU`. If you paste a channel link, the row tells you this ID.

#### Good fit

- You need the full list of videos of a course, podcast, music or tutorial playlist in a sheet.
- You audit or catalog many playlists and need exact positions and numbers.
- You want an official, stable data source with a clear quota.

#### Not a fit

- You have no API key and do not want one. This Actor does not work without a key.
- **Watch later** and **Liked videos** (`WL`, `LL`) and private playlists. Google gives them only to their owner after a sign-in, never with an API key.
- Comments, transcripts or search results. See [Related Actors](#related-actors).

### Get your API key

The key is free.

1. Open the [Google Cloud Console](https://console.cloud.google.com/) and make or pick a project.
2. Go to **APIs & Services → Library**, find **YouTube Data API v3** and click **Enable**.
3. Go to **APIs & Services → Credentials → Create credentials → API key**.
4. Copy the key into the **YouTube Data API key** field of this Actor.

Tip: in the key settings, limit the key to **YouTube Data API v3** only.

**Quota cost for you.** Google gives each project 10,000 quota units per day for free. Every request of this Actor costs 1 unit:

- 1 unit per 50 playlist entries;
- 1 more unit per 50 videos when **Include duration and view/like/comment counts** is on;
- 1 unit per run for the playlist names (up to 50 playlists).

| Videos in a run | Quota units with counts | Without counts | Share of the free daily quota (with counts) |
| ---: | ---: | ---: | ---: |
| 10 (the prefill) | 3 | 2 | 0.03% |
| 200 | 9 | 5 | 0.09% |
| 1,000 | 41 | 21 | 0.4% |
| 20,000 | 801 | 401 | 8% |

The quota resets at midnight Pacific Time. You can see your usage in Google Cloud Console → **APIs & Services → YouTube Data API v3 → Quotas**. Google does not charge money for this quota. See the [Google quota page](https://developers.google.com/youtube/v3/determine_quota_cost).

The key is a secret field: Apify stores it encrypted. The Actor sends it only to Google, in a request header. It never writes the key to the dataset, the logs or the run summary, and it removes it from any error text.

### Quick start

1. Get a key (see above).
2. The **Playlist URLs or IDs** field already has one example playlist, and **Max videos per playlist** is set to 10.
3. Paste your key into **YouTube Data API key**.
4. Click **Start**. Ten videos take a few seconds.
5. Open the **Videos** view of the dataset, or download it as CSV, Excel or JSON.

To export whole playlists, set **Max videos per playlist** higher (the default is 200, the maximum is 20,000).

If you click **Start** without a key, the run still ends as SUCCEEDED, with one `api_key_required` row that tells you how to get a key. Nothing is fetched and no video is charged. Apify charges the Actor start fee for every run, including this one (see [Pricing](#pricing-and-cost-examples)).

### Input

| Field | Type | Required | Default | Range | What it does |
| --- | --- | --- | --- | --- | --- |
| `playlistUrls` | array of strings | yes | prefill: 1 example playlist | 1–100 playlists | Playlist links or IDs, one per line. The same playlist twice is exported once. |
| `apiKey` | string, secret | yes, for real data | none | — | Your YouTube Data API v3 key. Without it you get one `api_key_required` row. |
| `maxItems` | integer | no | 200 (prefill 10) | 1–20,000 | Stop **each** playlist after this many entries. Private and deleted entries count too. |
| `includeStats` | boolean | no | `true` | — | Fill `durationSec`, `duration`, `views`, `likes`, `comments`. Costs 1 more quota unit per 50 videos. The Apify price is the same. |

`maxItems` works per playlist: with 3 playlists and `maxItems` 100 you get up to 300 rows.

### Input examples

#### One playlist, first 10 videos (the prefill plus your key)

```json
{
  "playlistUrls": ["https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH"],
  "maxItems": 10,
  "apiKey": "YOUR_API_KEY"
}
```

#### Whole playlists, titles and dates only (half the quota)

```json
{
  "playlistUrls": [
    "PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH",
    "https://www.youtube.com/watch?v=17WoOqgXsRM&list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH",
    "https://music.youtube.com/playlist?list=PL8F6B0753B2CCA128"
  ],
  "maxItems": 20000,
  "includeStats": false,
  "apiKey": "YOUR_API_KEY"
}
```

The second line is the same playlist as the first, so it is exported once.

### Output example

A real row (the description is cut here):

```json
{
  "status": "ok",
  "playlistId": "PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH",
  "playlistTitle": "Coding Challenges",
  "playlistChannelTitle": "The Coding Train",
  "playlistUrl": "https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH",
  "position": 1,
  "videoId": "17WoOqgXsRM",
  "url": "https://www.youtube.com/watch?v=17WoOqgXsRM&list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH",
  "title": "Coding Challenge 1: Starfield Simulation",
  "description": "This is the first in a new series of vid…",
  "channelTitle": "The Coding Train",
  "channelId": "UCvjgXvBlbQiydffZU7m1_aw",
  "publishedAt": "2016-04-13T03:17:50Z",
  "addedAt": "2016-04-13T03:17:51Z",
  "durationSec": 834,
  "duration": "PT13M54S",
  "views": 1389218,
  "likes": 29580,
  "comments": 1386,
  "thumbnailUrl": "https://i.ytimg.com/vi/17WoOqgXsRM/maxresdefault.jpg",
  "privacyStatus": "public",
  "unavailableReason": null,
  "errorCode": null,
  "message": null,
  "input": "https://youtu.be/17WoOqgXsRM?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH",
  "source": "youtube-data-api-v3",
  "fetchedAt": "2026-10-22T05:14:19.638Z"
}
```

A private video in another playlist (fields that are `null` are left out here):

```json
{
  "status": "unavailable",
  "playlistId": "PL8F6B0753B2CCA128",
  "position": 12,
  "videoId": "zGsGwFBoEgc",
  "url": "https://www.youtube.com/watch?v=zGsGwFBoEgc&list=PL8F6B0753B2CCA128",
  "addedAt": "2019-05-07T04:31:35Z",
  "privacyStatus": "private",
  "unavailableReason": "private",
  "message": "The video is private; YouTube hides its title and channel."
}
```

### Output fields

The **Videos** view shows the main columns. The **Status and errors** view shows the status, error code and message of every row; sort or filter it by `status` to find rows that are not `ok`.

| Field | Type | Can be null | Example | Meaning |
| --- | --- | --- | --- | --- |
| `status` | string | no | `ok` | Row status, see the table below. |
| `playlistId` | string | yes | `PLRqwX-V7Uu6…` | Playlist ID. `null` for a line that is not a playlist. |
| `playlistTitle` | string | yes | `Coding Challenges` | Playlist name. |
| `playlistChannelTitle` | string | yes | `The Coding Train` | Who owns the playlist. |
| `playlistUrl` | string | yes | `https://www.youtube.com/playlist?list=…` | Playlist link. |
| `position` | integer | yes | `1` | Place in the playlist, from 1. `null` only for status rows. |
| `videoId` | string | yes | `17WoOqgXsRM` | Video ID. |
| `url` | string | yes | `https://www.youtube.com/watch?v=…&list=…` | Opens the video inside the playlist. |
| `title` | string | yes | `Coding Challenge 1: Starfield Simulation` | Video title. `null` for private and deleted videos. |
| `description` | string | yes | | Video description. |
| `channelTitle`, `channelId` | string | yes | `The Coding Train` | Who uploaded the video. It can differ from the playlist owner. |
| `publishedAt` | string, ISO date UTC | yes | `2016-04-13T03:17:50Z` | When the video was published. |
| `addedAt` | string, ISO date UTC | yes | `2016-04-13T03:17:51Z` | When the video was added to the playlist. |
| `durationSec` | integer | yes | `834` | Length in seconds. `null` for a live or upcoming stream, or when counts are off. |
| `duration` | string | yes | `PT13M54S` | Length as YouTube gives it (ISO 8601). |
| `views`, `likes`, `comments` | integer | yes | `1389218` | Counts. `null` when the owner hides them, or when counts are off. |
| `thumbnailUrl` | string | yes | `https://i.ytimg.com/vi/…/maxresdefault.jpg` | Biggest thumbnail. |
| `privacyStatus` | string | yes | `public` | `public`, `unlisted`, `private` or `privacyStatusUnspecified`. |
| `unavailableReason` | string | yes | `private` | `private`, `deleted` or `unknown`, for `unavailable` rows. |
| `errorCode`, `message` | string | yes | `PLAYLIST_NOT_FOUND` | Reason, for rows that are not `ok`. |
| `input` | string | yes | | Your original line, as you typed it. |
| `source` | string | no | `youtube-data-api-v3` | Data source. |
| `fetchedAt` | string, ISO date UTC | no | `2026-10-22T05:14:19.638Z` | When the run read the data. |

#### Row statuses

| `status` | When | Charged |
| --- | --- | --- |
| `ok` | A video at this position | `playlist-video` event |
| `unavailable` | The video at this position is private or deleted | small `empty-result` event |
| `not_found` | The playlist does not exist, or it is private | small `empty-result` event |
| `invalid_input` | The line is not a playlist (for example a channel link, `WL` or `LL`) | small `empty-result` event |
| `api_key_required` | No key in the input (one row per run) | no event |
| `api_key_error` | Google rejected the key, or the API is not enabled for it (one row per run) | no event |
| `quota_exceeded` | Your daily quota ran out (one row) | no event |
| `error` | Google kept failing for a playlist after retries | no event |

#### Run summary

The run's key-value store has a `RUN_SUMMARY` record: run status (`SUCCEEDED`, `PARTIAL`, `EMPTY`, `API_KEY_REQUIRED`, `API_KEY_ERROR`, `QUOTA_EXCEEDED`, `INVALID_INPUT`, `ERROR`), stop reason (`QUOTA_LIMIT`, `CHARGE_LIMIT`, `TIME_LIMIT`, `SOURCE_ERROR`, `ABORTED` or none), row counts, quota units used, and one line per playlist with its outcome and size. The run's status message says the same in one line, for example `Exported 10 videos from 1 playlist(s).`

### Pricing and cost examples

Pay per event. Apify platform usage is included. Google does not charge for the API quota.

| Event | When | Free | Bronze | Silver | Gold and above |
| --- | --- | ---: | ---: | ---: | ---: |
| Actor start | once per run, charged by Apify automatically | $0.0008 | $0.0008 | $0.0008 | $0.0008 |
| Playlist video | per `ok` row | $0.0003 | $0.00027 | $0.00024 | $0.00021 |
| Empty result | per `unavailable`, `not_found` or `invalid_input` row | $0.00003 | $0.00003 | $0.00003 | $0.00003 |

That is $0.30 per 1,000 videos on the Free plan and $0.21 on Gold. **Include duration and view/like/comment counts** does not change the price.

| Example run | Free | Bronze | Silver | Gold+ |
| --- | ---: | ---: | ---: | ---: |
| No key (one `api_key_required` row) | $0.0008 | $0.0008 | $0.0008 | $0.0008 |
| 10 videos (the prefill) | $0.0038 | $0.0035 | $0.0032 | $0.0029 |
| 100 videos | $0.031 | $0.028 | $0.025 | $0.022 |
| 1,000 videos | $0.30 | $0.27 | $0.24 | $0.21 |
| 20,000 videos | $6.00 | $5.40 | $4.80 | $4.20 |
| 100 entries, all private or deleted | $0.0038 | $0.0038 | $0.0038 | $0.0038 |

Every run pays the start fee, also a run without a key or with a wrong key. Apify charges it automatically when a paid Actor starts. Put many playlists in one run instead of many small runs.

Set **Maximum cost per run** in the run options to cap a run. The Actor checks the limit before it saves each page of rows. It stops before a charge would go above the limit, keeps what it saved and ends as `PARTIAL` with reason `CHARGE_LIMIT`.

### Use cases

| Buyer job | Input | Key fields | Next step |
| --- | --- | --- | --- |
| Course or tutorial outline | the course playlist | `position`, `title`, `durationSec`, `url` | Make a syllabus or a watch plan with total hours |
| Audit a channel's playlists | the channel's playlist links | `views`, `likes`, `publishedAt`, `unavailableReason` | Find weak, private or deleted videos |
| Archive or back up a playlist | any public playlist | `videoId`, `title`, `channelTitle`, `addedAt` | Keep a record of what was in it |
| Content research | competitor playlists | `title`, `views`, `durationSec`, `publishedAt` | Compare topics, length and reach |
| Catalog for an app or model | many playlists | all fields | Join on `videoId` or `playlistId` |

### API, export and AI agents

- **Export:** download the dataset as JSON, CSV, Excel, XML or HTML.
- **API:** start a run with `POST https://api.apify.com/v2/acts/cliqtomedia~youtube-playlist-export/runs` and the input JSON. Read rows from the run's default dataset.
- **Scheduling:** use an Apify **Schedule** to export the same playlists every day or week and see new videos and new counts. The Actor does not keep data between runs.
- **Integrations:** Make, Zapier, n8n, webhooks and Google Sheets work through the standard Apify integrations. Use `playlistId` + `position` or `videoId` as a key.

#### Use with AI agents (MCP)

- MCP server with only this Actor: `https://mcp.apify.com?tools=cliqtomedia/youtube-playlist-export`
- Smallest useful input: `{"playlistUrls": ["PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH"], "maxItems": 10, "apiKey": "<the user's key>"}`
- Key output fields: `position`, `title`, `videoId`, `durationSec`, `views`, `status`.
- 10 videos take a few seconds. In our tests 1,000 videos took about 10 seconds and 20,000 videos about 5 minutes.
- The agent needs the user's own YouTube Data API key. Without it the run returns `api_key_required`.

### Limits and partial results

- Up to 100 playlists per run and up to 20,000 entries per playlist. We tested one run with 20,000 videos: done in about 300 seconds, 801 quota units, 79 MB of memory.
- YouTube itself gives at most 20,000 entries for a channel's uploads (`UU…`) playlist, so very big channels are cut there.
- The default run timeout is 600 seconds. For more than about 30,000 videos in one run, set a higher timeout in the run options. The Actor stops reading at 30 minutes or 20 seconds before the timeout, whichever comes first, keeps the saved rows and ends as `PARTIAL` with reason `TIME_LIMIT`.
- If your daily quota runs out during a run, the Actor keeps the rows it saved, ends as `PARTIAL` with reason `QUOTA_LIMIT`, and the run SUCCEEDED. Run the rest after the quota resets.
- If Google keeps failing for two playlists in a row, the run keeps saved rows and ends with reason `SOURCE_ERROR`.
- Counts are live at `fetchedAt` and change all the time.

Data comes from the [YouTube Data API v3](https://developers.google.com/youtube/v3/docs) under your own key and Google project. Please follow the [YouTube API Services Terms of Service](https://developers.google.com/youtube/terms/api-services-terms-of-service): they say you should not keep statistics such as views and likes for more than 30 days without refreshing them. Refresh them with a new run, or delete old datasets. This Actor is not affiliated with or endorsed by YouTube or Google.

### Troubleshooting

#### I got one `api_key_required` row

The **YouTube Data API key** field is empty. [Get a key](#get-your-api-key) and run again.

#### I got one `api_key_error` row

Likely reasons: a typo in the key, the key was deleted, **YouTube Data API v3** is not enabled in the key's project, or the key is limited to other APIs or websites. Check **APIs & Services → Enabled APIs** in Google Cloud Console. Enable the API, or make a new key.

#### The run ended with `QUOTA_LIMIT`

Your project used its 10,000 daily units. The rows saved before that are kept. Run again after midnight Pacific Time, or turn off **Include duration and view/like/comment counts** to use half the quota.

#### A playlist gives `not_found`

The playlist was deleted, is private, or the ID has a typo. Open `playlistUrl` in a browser while signed out. Only public and unlisted playlists can be read.

#### A line gives `invalid_input`

The line is not a playlist link or ID. For a channel link, the `message` gives the channel's uploads playlist ID (`UU…`): paste that instead. `WL` and `LL` are private to their owner. If no line in the run is a playlist, the run ends as `FAILED` with status `INVALID_INPUT`; the Actor start and the `invalid_input` rows are still charged as shown above.

#### Some rows are `unavailable`

The video at that position is private or deleted. YouTube hides its title and channel, so only the position, `videoId` and `addedAt` are known.

### FAQ

#### Do I need a YouTube or Google account?

You need a Google account to make the free API key. The Actor does not log in to YouTube and does not use cookies.

#### Why are some positions not in a row 1, 2, 3?

They are. Every entry gets a row, also private and deleted ones, so `position` always matches the YouTube player. Filter by `status = ok` if you want only playable videos.

#### Can I export my Watch later or Liked videos?

No. Google serves these lists only to their owner after a sign-in (OAuth). An API key cannot read them. You can copy the videos into a normal public or unlisted playlist first.

#### Does it cost Google money?

No. The YouTube Data API is free within the daily quota. You pay only the Apify price above.

#### Is personal data included?

Only public playlist and video data that YouTube shows: playlist and channel names and IDs. No viewer data.

### Related Actors

- [YouTube Search Results Scraper](https://apify.com/cliqtomedia/youtube-search-scraper) — find videos by keyword.
- [YouTube Comments Scraper](https://apify.com/cliqtomedia/youtube-comments-scraper) — get the comments of a video from your playlist.
- [YouTube Subtitles & Transcript Scraper](https://apify.com/cliqtomedia/youtube-transcript-scraper) — get the text of the videos.

### Support

For a bug, question or feature request, open an issue on the Actor's **Issues** tab. Add the run ID and your input, but **never post your API key**.

# Changelog

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

# Actor input Schema

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

Your own YouTube Data API v3 key (required). Free: Google Cloud Console → APIs & Services → enable "YouTube Data API v3" → Credentials → Create API key. Each run spends quota of this key (about 2 units per 50 videos; 10,000 units/day by default). Stored encrypted, never written to the dataset or logs.

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

Public or unlisted playlist links (youtube.com/playlist?list=…, or a watch link with list=…) or bare playlist IDs (PL…, UU…, OL…). Up to 100 per run. Watch later and Liked videos are private to the account and cannot be read with an API key.

## `maxItems` (type: `integer`):

Stop each playlist after this many entries (private and deleted entries count too). Set high to export whole playlists.

## `includeStats` (type: `boolean`):

Adds one extra API call per 50 videos (1 quota unit) to fetch duration, views, likes and comments. Turn off to export only titles, positions and dates at half the quota.

## Actor input object example

```json
{
  "playlistUrls": [
    "https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH"
  ],
  "maxItems": 10,
  "includeStats": true
}
```

# Actor output Schema

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

Every playlist entry as a table.

## `runSummary` (type: `string`):

Status, stop reason, per-playlist results and quota units used.

# 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"
    ],
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("cliqtomedia/youtube-playlist-export").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"],
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("cliqtomedia/youtube-playlist-export").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"
  ],
  "maxItems": 10
}' |
apify call cliqtomedia/youtube-playlist-export --silent --output-dataset

```

## MCP server setup

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

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/9gz5AeTNpH7vzx0CZ/builds/ifB2ulQw2Ub4m28wH/openapi.json
