YouTube.js
Guide
Discord
GitHub
Guide
Discord
GitHub

youtubei.js / YTNodes / VideoCard

Class: VideoCard

Extends

  • Video

Constructors

new VideoCard()

new VideoCard(data): VideoCard

Parameters

• data: RawNode

Returns

VideoCard

Overrides

Video.constructor

Defined in

src/parser/classes/VideoCard.ts:12

Properties

additional_metadatas?

optional additional_metadatas: Text[]

Inherited from

Video.additional_metadatas

Defined in

src/parser/classes/Video.ts:22


author

author: Author

Inherited from

Video.author

Defined in

src/parser/classes/Video.ts:26


badges

badges: MetadataBadge[]

Inherited from

Video.badges

Defined in

src/parser/classes/Video.ts:27


byline_text?

optional byline_text: Text

Overrides

Video.byline_text

Defined in

src/parser/classes/VideoCard.ts:10


description_snippet?

optional description_snippet: Text

Inherited from

Video.description_snippet

Defined in

src/parser/classes/Video.ts:19


endpoint?

optional endpoint: NavigationEndpoint

Inherited from

Video.endpoint

Defined in

src/parser/classes/Video.ts:28


expandable_metadata

expandable_metadata: null | ExpandableMetadata

Inherited from

Video.expandable_metadata

Defined in

src/parser/classes/Video.ts:21


is_watched

is_watched: boolean

Inherited from

Video.is_watched

Defined in

src/parser/classes/Video.ts:35


length_text?

optional length_text: Text

Inherited from

Video.length_text

Defined in

src/parser/classes/Video.ts:33


menu

menu: null | Menu

Inherited from

Video.menu

Defined in

src/parser/classes/Video.ts:36


metadata_text?

optional metadata_text: Text

Defined in

src/parser/classes/VideoCard.ts:9


published?

optional published: Text

Inherited from

Video.published

Defined in

src/parser/classes/Video.ts:29


rich_thumbnail?

optional rich_thumbnail: YTNode

Inherited from

Video.rich_thumbnail

Defined in

src/parser/classes/Video.ts:25


search_video_result_entity_key?

optional search_video_result_entity_key: string

Inherited from

Video.search_video_result_entity_key

Defined in

src/parser/classes/Video.ts:38


service_endpoint?

optional service_endpoint: NavigationEndpoint

Inherited from

Video.service_endpoint

Defined in

src/parser/classes/Video.ts:40


service_endpoints?

optional service_endpoints: NavigationEndpoint[]

Inherited from

Video.service_endpoints

Defined in

src/parser/classes/Video.ts:39


short_view_count?

optional short_view_count: Text

Inherited from

Video.short_view_count

Defined in

src/parser/classes/Video.ts:31


show_action_menu

show_action_menu: boolean

Inherited from

Video.show_action_menu

Defined in

src/parser/classes/Video.ts:34


snippets?

optional snippets: object[]

Inherited from

Video.snippets

Defined in

src/parser/classes/Video.ts:20


style?

optional style: "VIDEO_STYLE_TYPE_UNKNOWN" | "VIDEO_STYLE_TYPE_NORMAL" | "VIDEO_STYLE_TYPE_POST" | "VIDEO_STYLE_TYPE_SUB" | "VIDEO_STYLE_TYPE_LIVE_POST" | "VIDEO_STYLE_TYPE_FULL_BLEED_ISOLATED" | "VIDEO_STYLE_TYPE_WITH_EXPANDED_METADATA"

Inherited from

Video.style

Defined in

src/parser/classes/Video.ts:41


thumbnail_overlays

thumbnail_overlays: ObservedArray<YTNode>

Inherited from

Video.thumbnail_overlays

Defined in

src/parser/classes/Video.ts:24


thumbnails

thumbnails: Thumbnail[]

Inherited from

Video.thumbnails

Defined in

src/parser/classes/Video.ts:23


title

title: Text

Inherited from

Video.title

Defined in

src/parser/classes/Video.ts:17


type

readonly type: string

Inherited from

Video.type

Defined in

src/parser/helpers.ts:8


untranslated_title?

optional untranslated_title: Text

Inherited from

Video.untranslated_title

Defined in

src/parser/classes/Video.ts:18


upcoming?

optional upcoming: Date

Inherited from

Video.upcoming

Defined in

src/parser/classes/Video.ts:32


video_id

video_id: string

Inherited from

Video.video_id

Defined in

src/parser/classes/Video.ts:16


view_count?

optional view_count: Text

Inherited from

Video.view_count

Defined in

src/parser/classes/Video.ts:30


type

static type: string = 'VideoCard'

Overrides

Video.type

Defined in

src/parser/classes/VideoCard.ts:7

Accessors

best_thumbnail

get best_thumbnail(): undefined | Thumbnail

Returns

undefined | Thumbnail

Inherited from

Video.best_thumbnail

Defined in

src/parser/classes/Video.ts:148


description

get description(): string

Returns

string

Inherited from

Video.description

Defined in

src/parser/classes/Video.ts:119


duration

get duration(): object

Returns

object

seconds

seconds: number

text

text: undefined | string = length_text

Inherited from

Video.duration

Defined in

src/parser/classes/Video.ts:152


has_captions

get has_captions(): boolean

Returns

boolean

Inherited from

Video.has_captions

Defined in

src/parser/classes/Video.ts:144


id

get id(): string

Deprecated

Use video_id instead.

Returns

string

Inherited from

Video.id

Defined in

src/parser/classes/Video.ts:115


is_4k

get is_4k(): boolean

Returns

boolean

Inherited from

Video.is_4k

Defined in

src/parser/classes/Video.ts:140


is_live

get is_live(): boolean

Returns

boolean

Inherited from

Video.is_live

Defined in

src/parser/classes/Video.ts:125


is_premiere

get is_premiere(): boolean

Returns

boolean

Inherited from

Video.is_premiere

Defined in

src/parser/classes/Video.ts:136


is_upcoming

get is_upcoming(): undefined | boolean

Returns

undefined | boolean

Inherited from

Video.is_upcoming

Defined in

src/parser/classes/Video.ts:132

Methods

as()

as<T, K>(...types): InstanceType<K[number]>

Cast to one of the given types.

Type Parameters

• T extends YTNode

• K extends YTNodeConstructor<T>[]

Parameters

• ...types: K

The types to cast to

Returns

InstanceType<K[number]>

The node cast to one of the given types

Throws

If the node is not of the given type

Inherited from

Video.as

Defined in

src/parser/helpers.ts:29


hasKey()

hasKey<T, R>(key): this is VideoCard & { [k in string]: R }

Check for a key without asserting the type.

Type Parameters

• T extends string

• R = any

Parameters

• key: T

The key to check

Returns

this is VideoCard & { [k in string]: R }

Whether the node has the key

Inherited from

Video.hasKey

Defined in

src/parser/helpers.ts:41


is()

is<T, K>(...types): this is InstanceType<K[number]>

Check if the node is of the given type.

Type Parameters

• T extends YTNode

• K extends YTNodeConstructor<T>[]

Parameters

• ...types: K

The type to check

Returns

this is InstanceType<K[number]>

whether the node is of the given type

Inherited from

Video.is

Defined in

src/parser/helpers.ts:19


key()

key<T, R>(key): Maybe

Assert that the node has the given key and return it.

Type Parameters

• T extends string

• R = any

Parameters

• key: T

The key to check

Returns

Maybe

The value of the key wrapped in a Maybe

Throws

If the node does not have the key

Inherited from

Video.key

Defined in

src/parser/helpers.ts:51

Edit this page
Last Updated:: 6/8/25, 5:43 PM
Contributors: Luan