YouTube.js
Guide
Discord
❤️ Sponsor
GitHub
Guide
Discord
❤️ Sponsor
GitHub

youtubei.js / YT / Comments

Class: Comments

Defined in: src/parser/youtube/Comments.ts:15

Constructors

Constructor

new Comments(actions, data, already_parsed): Comments

Defined in: src/parser/youtube/Comments.ts:23

Parameters

actions

Actions

data

any

already_parsed

boolean = false

Returns

Comments

Properties

contents

contents: ObservedArray<CommentThread>

Defined in: src/parser/youtube/Comments.ts:21


header?

optional header: CommentsHeader

Defined in: src/parser/youtube/Comments.ts:20

Accessors

has_continuation

Get Signature

get has_continuation(): boolean

Defined in: src/parser/youtube/Comments.ts:117

Returns

boolean


page

Get Signature

get page(): INextResponse

Defined in: src/parser/youtube/Comments.ts:121

Returns

INextResponse

Methods

applySort()

applySort(sort): Promise<Comments>

Defined in: src/parser/youtube/Comments.ts:53

Applies given sort option to the comments.

Parameters

sort

Sort type.

"TOP_COMMENTS" | "NEWEST_FIRST"

Returns

Promise<Comments>


createComment()

createComment(text): Promise<ApiResponse>

Defined in: src/parser/youtube/Comments.ts:80

Creates a top-level comment.

Parameters

text

string

Comment text.

Returns

Promise<ApiResponse>


getContinuation()

getContinuation(): Promise<Comments>

Defined in: src/parser/youtube/Comments.ts:98

Retrieves next batch of comments.

Returns

Promise<Comments>

Edit this page
Last Updated: 10/12/25, 3:23 PM