SpotifyApiSpotify LogoJS

ArtistManager src/managers/Artist.ts#L20

A manager to perform actions which belongs to the spotify artist web api.


Properties:

client

Methods:

follow get getAlbums getMultiple getRelatedArtists getTopTracks search unfollow

constructor(client) src/managers/Artist.ts#L20

No documentation found.

NameTypeDescription
clientClientThe spotify api client.

.client

Type:

Client

No documentation found.

.follow(ids) src/managers/Artist.ts#L127

Follow one or many artists. This method requires an user authorized token.

await client.artists.follow('id1', 'id2');

Returns:

Promise<boolean>

Parameters:

NameTypeDescription
idsstring[]The array of artist ids.

.get(id, force) src/managers/Artist.ts#L51

Get an artist's information.

const artist = await client.artists.get('id');

Returns:

Promise<"null" | Artist>

Parameters:

NameTypeDescription
idstringThe spotify artist id.
forcebooleanWhen true, will directly fetch else will search for the cache first!

.getAlbums(id, options) src/managers/Artist.ts#L99

Get the informations of albums of the artist.

const albums = await client.artists.getAlbums('id');

Returns:

Promise<Album[]>

Parameters:

NameTypeDescription
idstringThe spotify artist id.
options{ includeGroups?: AlbumGroup, limit?: number, market?: string, offset?: number, }The options necessary to get the albums in a sorted way.

.getMultiple(ids) src/managers/Artist.ts#L63

Get the information of multiple spotify artists in one fetch.

const artists = await client.artists.getMultiple(['id1', 'id2']);

Returns:

Promise<Artist[]>

Parameters:

NameTypeDescription
idsstring[]An array of spotify ids.

.getRelatedArtists(id) src/managers/Artist.ts#L87

Get the information of the artists who are related to a paticular artist.

const relatedArtists = await client.artists.getRelatedArtists('id');

Returns:

Promise<Artist[]>

Parameters:

NameTypeDescription
idstringThe spotify artist id.

.getTopTracks(id, market) src/managers/Artist.ts#L76

Get the information of top tracks from the spotify artist.

const topTracks = await client.artists.getTopTracks('id');

Returns:

Promise<Track[]>

Parameters:

NameTypeDescription
idstringThe spotify artist id.
marketstringThe market query option.

.search(query, options) src/managers/Artist.ts#L29

Search for spotify artists with query.

const results = await client.artists.search('some search');

Returns:

Promise<Artist[]>

Parameters:

NameTypeDescription
querystringThe query to search.
optionsSearchOptionsSome search options to make the search more efficient.

.unfollow(ids) src/managers/Artist.ts#L141

Unfollow one or many artists. This method requires an user authorized token.

await client.artists.unfollow('id1', 'id2');

Returns:

Promise<boolean>

Parameters:

NameTypeDescription
idsstring[]The array of artist ids.