Class: SearchResult
Represents the continuable search results container returned from client.search(...).
Hierarchy
BaseContinuable<VideoCompact | PlaylistCompact | ChannelCompact>SearchResult
Properties
items: (VideoCompact | PlaylistCompact | ChannelCompact)[]
A list of all loaded search items.
continuation: string | null
The continuation token for fetching the next page of search results.
Methods
next(count?: number): Promise<(VideoCompact | PlaylistCompact | ChannelCompact)[]>
Fetches the next batch of search items.
- Parameters:
count:number(optional) - Number of items to retrieve. If not supplied, fetches the next single page of results. Note:next(0)fetches 0 items (returns an empty array). To fetch all items, use a while loop withnext().
- Returns:
Promise<(VideoCompact | PlaylistCompact | ChannelCompact)[]>
Compact Result Item Models
VideoCompact
Represents a video in search results.
id: stringtitle: stringthumbnails: Thumbnailsduration: number | nullisLive: booleanchannel: ChannelInfo (id, name, thumbnails)viewCount: number | nullpublishedAt: string | null
PlaylistCompact
Represents a playlist in search results.
id: stringtitle: stringthumbnails: ThumbnailsvideoCount: numberchannel: ChannelInfo (id, name, thumbnails)
ChannelCompact
Represents a channel in search results.
id: stringname: stringthumbnails: ThumbnailssubscriberCount: string | null