# youtube.playlist

The videos of a YouTube playlist, in order: title, length, views, age and thumbnail for each, up to 1,000.

YouTube playlist, one of the YouTube scrapers.

| | |
| --- | --- |
| Id | `youtube.playlist` |
| Version | 1 |
| Billed per | record — 1 unit for each record of a charged run |
| Runs | within one request |

Start it with `POST /v1/scrapers/youtube.playlist/runs`. How runs work is in [Running a scraper](https://docs.enrichednow.com/running-a-scraper.md); what a run costs is in [Usage and units](https://docs.enrichednow.com/usage-and-units.md).

## Inputs

The fields of `input`. A field that is not listed here is refused.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `playlist` | string | yes | The playlist: its id (PL…, or a channel's uploads list UU…) or any youtube.com address that carries it as list=<id>. Limit: at most 500 characters. |
| `max_results` | integer | no | The most videos to return, in the playlist's order. A playlist loads 100 at a time, so a larger number takes longer. Limit: 1 to 1000. Default: `100`. |

- `playlist` is the playlist's id or any YouTube address that carries it as `list=`. A channel's uploads list (`UU…`) is a playlist too. A mix (`RD…`), which YouTube builds for each viewer, is refused with `invalid_input`.
- A playlist loads 100 videos at a time. `max_results` is 100 by default and goes up to 1,000; a larger number takes longer. If a later batch cannot be loaded, the run ends `partial` with the videos it has.
- Videos a playlist hides — private or removed — are not listed by YouTube and are not returned, so a playlist that says "13 videos" can return 10.
- `channel_name` and `channel_id` are filled when the playlist names the video's channel, and for a channel's uploads list; otherwise they are `null`.
- A playlist that does not exist, or is private, ends the run `failed` with `not_found`.
- Billed per record: a charged run costs 1 unit for each video it returns.

## Record fields

Every record of a run has these fields. A value that is not known is `null` — never an empty string and never `0`.

| Field | Type | Notes |
| --- | --- | --- |
| `position` | integer | Its place among the returned videos, from 1, in the playlist's order. Videos the playlist hides (private or removed) are not counted. |
| `id` | string | The video id. |
| `url` | string | The video's address: youtube.com/watch?v=<id>. |
| `title` | string or null | The title as shown. |
| `playlist_id` | string | The id of the playlist that was read. |
| `playlist_title` | string or null | That playlist's title. |
| `channel_name` | string or null | The channel that published the video, when the playlist names it; otherwise the playlist's owner when every video is the owner's. |
| `channel_id` | string or null | That channel's id (UC…). |
| `channel_url` | string or null | That channel's address, as the page links it. |
| `channel_handle` | string or null | @name, when the page links the channel by its handle. |
| `published_text` | string or null | When the video was published, as shown ("9 years ago"). |
| `duration_text` | string or null | The length as shown ("15:29"). |
| `duration_seconds` | integer or null | The length in seconds, read from `duration_text`; null when no length is shown. |
| `view_count_text` | string or null | The views as shown ("4.4M views"). |
| `view_count` | integer or null | The views as a number, when the text reads as one. |
| `view_count_exact` | boolean or null | True when YouTube showed the count in full, false when it showed it rounded; null when no count was read. |
| `thumbnails` | array of object | The video's thumbnail, in the sizes the page lists, smallest first. |
| `thumbnails[].url` | string | The image's address. |
| `thumbnails[].width` | integer or null | Its width in pixels, when the page states it. |
| `thumbnails[].height` | integer or null | Its height in pixels, when the page states it. |

## Example request

It starts a run with this scraper's example input and waits up to 60 seconds for it. The key is read from `ENRICHEDNOW_API_KEY`.

```bash
curl -X POST "https://api.enrichednow.com/v1/scrapers/youtube.playlist/runs?wait=60" \
  -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"playlist":"PL-osiE80TeTt2d9bfVyTiXJA-UTHn6WwU","max_results":12}}'
```

## Example response

The run, once it has ended. A run that has not ended within `wait` comes back with `202` and the status `queued` or `running`.

```json
{
  "id": "run_841742f37553189ff9c27ba1",
  "scraper_id": "youtube.playlist",
  "scraper_version": 1,
  "status": "ok",
  "reason": null,
  "input": {
    "playlist": "PL-osiE80TeTt2d9bfVyTiXJA-UTHn6WwU",
    "max_results": 12
  },
  "record_count": 1,
  "units": 1,
  "units_per_request": null,
  "units_per_record": 1,
  "units_per_page": null,
  "diagnostics": {
    "requests": 1,
    "bytes": 259214,
    "wall_ms": 885,
    "facts": {}
  },
  "created_at": "2026-11-16T22:37:50.170950Z",
  "started_at": "2026-11-16T22:37:50.178331Z",
  "finished_at": "2026-11-16T22:37:51.066313Z"
}
```

Its records, from `GET /v1/runs/{id}/records`. The record is a real one: this scraper's own parser read it from a page recorded from the site.

```json
{
  "records": [
    {
      "position": 1,
      "id": "YYXdXT2l-Gg",
      "url": "https://www.youtube.com/watch?v=YYXdXT2l-Gg",
      "title": "Python Tutorial for Beginners 1: Install and Setup for Mac and Windows",
      "playlist_id": "PL-osiE80TeTt2d9bfVyTiXJA-UTHn6WwU",
      "playlist_title": "Python Tutorials",
      "channel_name": null,
      "channel_id": null,
      "channel_url": null,
      "channel_handle": null,
      "published_text": "9 years ago",
      "duration_text": "15:29",
      "duration_seconds": 929,
      "view_count_text": "4.4M views",
      "view_count": 4400000,
      "view_count_exact": false,
      "thumbnails": [
        {
          "url": "https://i.ytimg.com/vi/YYXdXT2l-Gg/hqdefault.jpg?sqp=-oaymwEmCKgBEF5IWvKriqkDGQgBFQAAiEIYAdgBAeIBCggYEAIYBjgBQAE=&rs=AOn4CLAD2NeYN-eWQZCpZFGVNeNNv_UBGA",
          "width": 168,
          "height": 94
        },
        {
          "url": "https://i.ytimg.com/vi/YYXdXT2l-Gg/hqdefault.jpg?sqp=-oaymwEmCMQBEG5IWvKriqkDGQgBFQAAiEIYAdgBAeIBCggYEAIYBjgBQAE=&rs=AOn4CLCd266tPr29bAHihRRuvo2Mdlpg0Q",
          "width": 196,
          "height": 110
        }
      ]
    }
  ],
  "next_cursor": null
}
```

What was done to the record for this page, and nothing else — the API returns every value whole. A text that was cut ends with `… [truncated]`.

- Shortened: `thumbnails`: 4 items, the first 2 shown.

A run does not always end `ok`. [Results and statuses](https://docs.enrichednow.com/results-and-statuses.md#reason-codes) lists every status and the reasons every scraper shares; [the reasons of the YouTube scrapers](https://docs.enrichednow.com/results-and-statuses.md#youtube) are in their own section there.
