youtube/search
read-only
Videos matching a search query, in YouTube's order (Shorts shelves, playlists and ads skipped).
await page.runPlugin("youtube/search", { query: "<query>" })
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
queryrequired | stringmin length 1 | Search terms. | |
limit | integer1–100 | 20 | Maximum number of videos. |
Returns
{
query: string,
videos: {
id: string,
url: string,
title: string,
channel: {
name: string,
id?: string | null,
url: string | null,
handle?: string | null
},
duration: string | null,
durationSeconds: integer | null,
views: string | null,
viewCount: integer | null,
published: string | null,
live: boolean,
description?: string | null
}[]
}
youtube/video
read-only
One video's title, channel, publish date, views, likes, duration, full description and chapters.
await page.runPlugin("youtube/video")
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
url | string | Video URL (youtube.com/watch, youtu.be, shorts, live, embed). | |
id | string/^[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
| Name | Type | Default | Description |
|---|---|---|---|
url | string | Video URL. | |
id | string/^[A-Za-z0-9_-]{11}$/ | 11-character video id (instead of url). | |
lang | stringmin 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
| Name | Type | Default | Description |
|---|---|---|---|
url | string | Video URL. | |
id | string/^[A-Za-z0-9_-]{11}$/ | 11-character video id (instead of url). | |
limit | integer1–200 | 20 | Maximum 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
}[]
}