YouTube Playlist API

The FetchTranscript YouTube Playlist API takes a playlist ID and returns its videos in order, up to 100 per call, with position, title, duration, views, publish time and channel. A cursor takes you from one page to the next, so the last page of a playlist of thousands of videos is as fast and as cheap as the first. Together with the transcript endpoint it turns a course, a series or a podcast playlist into text.

No credit card needed. One API key works on every endpoint.

Quick example

GET/v1/playlists/{playlist_id}/videos?limit=30&cursor={next_cursor}

Put the playlist ID in the path and your API key in the X-API-Key header. Leave cursor out for the first page.

# First page: 50 videos
curl "https://api.fetchtranscript.com/v1/playlists/PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI/videos?limit=50" \
  -H "X-API-Key: yt_your_api_key"

# Next page: pass the next_cursor of the previous answer
curl "https://api.fetchtranscript.com/v1/playlists/PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI/videos?limit=50&cursor=NEXT_CURSOR" \
  -H "X-API-Key: yt_your_api_key"

Sample response

The first page of two videos, requested with limit=2.

{
  "playlist_id": "PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI",
  "videos": [
    {
      "video_id": "fOT0BUpITw8",
      "title": "BELLAKEO (Video Oficial) - Peso Pluma, Anitta",
      "description": null,
      "thumbnail_url": "https://i.ytimg.com/vi/fOT0BUpITw8/hqdefault.jpg",
      "duration": 235,
      "view_count": 780000000,
      "position": 1,
      "published_time_text": "2 years ago",
      "channel_id": "UCzrM_068Odho89mTRrrxqbA",
      "channel_name": "Peso Pluma"
    },
    {
      "video_id": "kJQP7kiw5Fk",
      "title": "Luis Fonsi - Despacito ft. Daddy Yankee",
      "description": null,
      "thumbnail_url": "https://i.ytimg.com/vi/kJQP7kiw5Fk/hqdefault.jpg",
      "duration": 282,
      "view_count": 8800000000,
      "position": 2,
      "published_time_text": "8 years ago",
      "channel_id": "UCxoq-PAQeAdk_zyg8YS0JqA",
      "channel_name": "Luis Fonsi"
    }
  ],
  "total_videos": 182,
  "total_pages": 91,
  "limit": 2,
  "has_more": true,
  "next_cursor": "eyJ2IjoxLCJrIjoicGxheWxpc3Qi..."
}

Illustrative values: a real response carries the live data of the video or channel you ask for.

Fields

FieldTypeDescription
playlist_idstringThe playlist ID you asked for.
videos[].video_idstringThe video ID, ready for the transcript, comments and metadata endpoints.
videos[].titlestringThe video title.
videos[].positionintegerThe video’s place in the playlist, 1 for the first.
videos[].durationinteger | nullLength in seconds; null for live streams and premieres.
videos[].view_countinteger | nullViews as the playlist page rounds them (780M becomes 780000000).
videos[].published_time_textstring | nullWhen it was published, as YouTube shows it (“2 years ago”). The metadata endpoint has the exact date.
videos[].channel_id, channel_namestring | nullThe channel that published the video, which can differ from the playlist’s owner.
videos[].thumbnail_urlstring | nullURL of the video thumbnail.
videos[].descriptionnullAlways null: playlists do not carry descriptions. Same shape as the channel video list.
total_videosinteger | nullHow many videos the playlist says it has, null when YouTube does not show it.
total_pagesinteger | nulltotal_videos divided by limit, rounded up: how many calls the whole playlist takes.
limitintegerThe page size you asked for.
has_morebooleanTrue when there is another page.
next_cursorstring | nullPass it as cursor to get the next page; null on the last page.

Parameters

ParameterInTypeDefaultDescription
playlist_idpathstringrequiredThe list= value of a playlist URL, such as PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI. Channel upload lists (UU…) and album playlists (OLAK5uy_…) work too.
limitqueryinteger30Videos per page, from 1 to 100.
cursorquerystringnoneThe next_cursor of the previous page. Leave it out for the first page.

A malformed ID is refused with 400 invalid_playlist_id, a modified or foreign cursor with 400 invalid_parameter, and a limit out of range with a 422 validation error. None of these is billed.

Pagination with a cursor

Every answer carries next_cursor: send it back as cursor with the same playlist to get the next page, until has_more is false and next_cursor is null. The cursor is opaque: store it as it is and do not build or edit it. You can change limit from one page to the next.

total_videos is the count the playlist shows and total_pages tells you how many calls the whole list takes at your limit. YouTube hides deleted and private videos from playlists, so the list can be a few videos shorter than the count. Pages are cached for one hour.

Transcripts of a whole playlist

Give it a playlist, get back the transcript of every video: the SDK iterator pages through the playlist 100 videos at a time, then you fetch each transcript. Catch the error of videos without captions and move on.

from fetchtranscript import FetchTranscriptClient, VideoNotFoundError

client = FetchTranscriptClient(api_key="yt_your_api_key")

# Pages of 100 videos, following next_cursor until the end of the playlist
transcripts = {}
for video in client.playlists.iter_videos("PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI"):
    try:
        transcripts[video["video_id"]] = client.transcripts.get_text(video["video_id"])
    except VideoNotFoundError as error:
        # No captions on this video: the failed call is not billed
        print("skipped", video["video_id"], error)

print(len(transcripts), "transcripts")
import { FetchTranscriptClient, VideoNotFoundError } from 'fetchtranscript';

const client = new FetchTranscriptClient({ apiKey: 'yt_your_api_key' });

const transcripts = new Map<string, string>();
for await (const video of client.playlists.iterVideos('PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI')) {
  try {
    transcripts.set(video.video_id, await client.transcripts.getText(video.video_id));
  } catch (error) {
    if (!(error instanceof VideoNotFoundError)) throw error; // no captions: skip it
  }
}

For a playlist of 200 videos this is 2 calls to list them and at most 200 transcript calls, 202 credits in all, about $0.20 at pay-as-you-go prices. For channels, the YouTube Channel API lists a channel’s videos the same way, and the bulk packs lower the price per call for large jobs.

Use cases

Transcripts of a whole playlist

Turn a course, a lecture series or a podcast season into text: list the playlist, then fetch every transcript for search, summaries or a chatbot’s knowledge base.

Course and curriculum catalogues

Import a YouTube course into a learning platform in the right order, with each lesson’s position, title, duration and thumbnail.

Music and chart tracking

Follow the videos of chart and genre playlists over time: what entered, what moved up, and how many views each one has.

Monitoring a playlist

Poll the first page of a playlist every day and get notified when a video is added, with its channel and publish time.

Every upload of a channel

The uploads list of a channel (its UC… ID with UU instead of UC) is a playlist: page through all of a creator’s videos at the same cost per page, however deep.

Datasets for research and AI

Collect curated video lists as structured JSON for analysis, labelling or model training, then add metadata, comments and transcripts per video.

Pricing

Each page of up to 100 videos costs one credit, at any depth: listing a playlist of 1,000 videos takes 10 calls.

  • 100 free calls every month, no credit card
  • Then $1 per 1,000 calls, pay as you go
  • Only successful calls are billed: errors cost nothing
  • Credits valid for 12 months; bulk packs from 10,000 calls for $9

See all prices and bulk packs →

Also in the MCP server for AI assistants

The FetchTranscript MCP server gives Claude, Cursor and other MCP clients the same data as tools: list_playlist_videos and get_transcript. Ask “summarize the lessons of this course playlist” and the assistant calls list_playlist_videos, then reads the videos with get_transcript.

Run it with uvx fetchtranscript-mcp and your API key in FETCHTRANSCRIPT_API_KEY; the MCP server guide has the configuration for each client. Tool calls are billed like API calls.

YouTube Playlist API: frequently asked questions

How do I list all the videos of a YouTube playlist?
Call GET /v1/playlists/{playlist_id}/videos with limit up to 100, then pass the next_cursor of each answer as cursor until has_more is false. The Python and TypeScript SDKs do it for you with iter_videos and iterVideos.
Is a page deep in a big playlist slower or more expensive?
No. The cursor goes straight to the next page, so page 50 of a playlist of thousands of videos costs one credit and takes about as long as page 1.
Where do I find the playlist ID?
In the playlist URL: it is the value after list=, for example PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI in youtube.com/playlist?list=PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI. The free try above also accepts the whole link.
Can I list private playlists or Mixes?
No. The API reads public and unlisted playlists. A private playlist or a Mix (the auto-generated radio that starts with RD) answers 404 playlist_unavailable, and a playlist that does not exist answers 404 playlist_not_found. Neither is billed.
Does the list include publish dates?
It includes the relative time YouTube shows, such as “2 years ago”, in published_time_text. For the exact upload date, likes and tags of a video, call the video metadata endpoint.
How much does the YouTube Playlist API cost?
One credit per successful call, whatever the page: a playlist of 1,000 videos takes 10 calls of 100. Every account gets 100 free calls per month, then it is $1 per 1,000 calls.

Get a playlist’s videos and transcripts

Create an account and get 100 free calls every month, enough to list a playlist and read a few of its videos.