← All plugins

YouTube

Search YouTube and read video details, transcripts and comments using the signed-in browser session.

youtube v1.0.0 4 commands

youtube/video

read-only

One video's title, channel, publish date, views, likes, duration, full description and chapters.

await page.runPlugin("youtube/video")

Arguments

NameTypeDefaultDescription
urlstringVideo URL (youtube.com/watch, youtu.be, shorts, live, embed).
idstring
/^[A-Za-z0-9_-]{11}$/
11-character video id (instead of url).

Returns

{
  id: string,
  url: string,
  title: string,
  channel: {
    name: string,
    id: string,
    url: string,
    handle?: string | null,
    subscribers?: string | null
  },
  published: string | null,
  publishDate?: string | null,
  views: string | null,
  viewCount: integer | null,
  likes: string | null,
  likeCount: integer | null,
  duration: string | null,
  durationSeconds: integer | null,
  isLive?: boolean,
  category?: string | null,
  description: string,
  chapters: {
    title: string,
    start: integer
  }[]
}

youtube/transcript

read-only

Timed transcript of a video from its transcript panel, in the default or a requested caption language. Fails NOT_FOUND when the video has no transcript.

await page.runPlugin("youtube/transcript")

Arguments

NameTypeDefaultDescription
urlstringVideo URL.
idstring
/^[A-Za-z0-9_-]{11}$/
11-character video id (instead of url).
langstring
min length 1
Caption language code or name, e.g. en, pt-BR, Japanese. Default: the language YouTube opens the transcript in.

Returns

{
  id: string,
  url: string,
  title?: string,
  language: {
    code: string | null,
    name: string | null,
    autoGenerated: boolean
  },
  available: {
    code: string,
    name: string,
    autoGenerated: boolean
  }[],
  segments: {
    start: number,
    end: number,
    text: string
  }[]
}

youtube/comments

read-only

Top-level comments of a video in YouTube's default Top order.

await page.runPlugin("youtube/comments")

Arguments

NameTypeDefaultDescription
urlstringVideo URL.
idstring
/^[A-Za-z0-9_-]{11}$/
11-character video id (instead of url).
limitinteger
1–200
20Maximum number of comments.

Returns

{
  id: string,
  url: string,
  commentCount: integer | null,
  disabled: boolean,
  message?: string | null,
  comments: {
    id: string,
    author: string,
    authorUrl?: string | null,
    text: string,
    likes: integer,
    likesText: string,
    published: string | null,
    edited?: boolean,
    pinned?: boolean,
    replies?: integer
  }[]
}