Skip to main content

Class: MusicClient

Youtube Music Client

Constructors

constructor

new MusicClient(options?)

Parameters

NameType
optionsPartial<HTTPOptions>

Methods

getLyrics

getLyrics(id): Promise<undefined | MusicLyrics>

Get lyrics of a song

Parameters

NameType
idstring

Returns

Promise<undefined | MusicLyrics>


search(query): Promise<Shelf<MusicVideoCompact[] | MusicAlbumCompact[] | MusicPlaylistCompact[] | MusicArtistCompact[]>[]>

Searches for video, song, album, playlist, or artist

Parameters

NameTypeDescription
querystringThe search query

Returns

Promise<Shelf<MusicVideoCompact[] | MusicAlbumCompact[] | MusicPlaylistCompact[] | MusicArtistCompact[]>[]>

search<T>(query, type): Promise<MusicSearchResult<T>>

Type parameters

NameType
Textends MusicSearchType

Parameters

NameType
querystring
typeT

Returns

Promise<MusicSearchResult<T>>


searchAll

searchAll(query): Promise<{ shelves: Shelf<MusicVideoCompact[] | MusicAlbumCompact[] | MusicPlaylistCompact[] | MusicArtistCompact[]>[] ; top?: MusicTopShelf }>

Searches for all video, song, album, playlist, or artist

Parameters

NameTypeDescription
querystringThe search query

Returns

Promise<{ shelves: Shelf<MusicVideoCompact[] | MusicAlbumCompact[] | MusicPlaylistCompact[] | MusicArtistCompact[]>[] ; top?: MusicTopShelf }>