SpotifyApiSpotify LogoJS

BrowseManager src/managers/Browse.ts#L19

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


Properties:

client

Methods:

getAvailableMarkets getCategories getCategory getCategoryPlaylists getFeaturedPlaylists getNewReleases getRecommendationGenreSeeds getRecommendations

constructor(client) src/managers/Browse.ts#L19

No documentation found.

NameTypeDescription
clientClientThe spotify api client.

.client

Type:

Client

No documentation found.

.getAvailableMarkets() src/managers/Browse.ts#L147

Get all the available markets.

const { markets } = await client.browse.getMarkets();

Returns:

Promise<Record<"markets", string[]>>

Parameters:

NameTypeDescription

.getCategories(options) src/managers/Browse.ts#L66

Get an array of all categories.

const categories = await browse.getCategories();

Returns:

Promise<Category[]>

Parameters:

NameTypeDescription
options{ country?: string, limit?: number, locale?: string, offset?: number, }The country, locale, offset, limit query parameters options.
OPTIONAL

.getCategory(id, options) src/managers/Browse.ts#L85

Get the brief information about a paticular category.

const category = await browse.getCategory('party');

Returns:

Promise<"null" | Category>

Parameters:

NameTypeDescription
idstringThe category id.
options{ country?: string, locale?: string, }The country, locale query parameters options.
OPTIONAL

.getCategoryPlaylists(id, options) src/managers/Browse.ts#L102

Get the playlists of a paticular category.

const playlists = await browse.getCategoryPlaylists('party');

Returns:

Promise<Playlist[]>

Parameters:

NameTypeDescription
idstringThe spotify category id.
options{ country?: string, limit?: number, offset?: number, }The country, offset, limit query parameters options.
OPTIONAL

.getFeaturedPlaylists(options) src/managers/Browse.ts#L44

Get the featured playlists.

const playlists = await browse.getFeaturedPlaylists();

Returns:

Promise<"null" | FeaturedPlaylistContent>

Parameters:

NameTypeDescription
options{ country?: string, limit?: number, locale?: string, offset?: number, timestamp?: string, }The country, locale, timestamp, offset, limit query parameters options.
OPTIONAL

.getNewReleases(options) src/managers/Browse.ts#L27

Get all the new album releases.

const albums = await browse.getNewReleases();

Returns:

Promise<Album[]>

Parameters:

NameTypeDescription
options{ country?: string, limit?: number, offset?: number, }The country, offset, limit query parameters options.
OPTIONAL

.getRecommendationGenreSeeds() src/managers/Browse.ts#L138

Get all the recommendation genres.

const genres = await browse.getRecommendationGenreSeeds();

Returns:

Promise<Record<"genres", string[]>>

Parameters:

NameTypeDescription

.getRecommendations(options) src/managers/Browse.ts#L125

Get all the recommendations from the api sorted by the [RecommendationQuery] structure.

const genres = await browse.getRecommendations({
    seed_artists: 'artists_id',
    seed_genre: 'genre',
    seed_tracks: 'tracks
});

Returns:

Promise<"null" | Recommendations>

Parameters:

NameTypeDescription
optionsRecommendationQueryThe [RecommendationQuery] options structure which will be sent as query paramaters.