Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ArtistsApi

Index

Constructors

constructor

Properties

Private http

http: Http

Methods

getArtist

  • getArtist(artistId: string): Promise<Artist>
  • Get Spotify catalog information for a single artist identified by their unique Spotify ID.

    Required Scopes: None.

    example
    const artist = await spotify.artists.getArtist('4Ge8xMJNwt6EEXOzVXju9a');
    console.log(artist.name);
    // "Caroline Polachek"

    Parameters

    • artistId: string

      The Spotify ID for the artist.

    Returns Promise<Artist>

getArtistAlbums

  • Get Spotify catalog information about an artist's albums.

    Required Scopes: None.

    example
    const albums = await spotify.artists.getArtistAlbums('2mHjhKyKCLh6MZELuCe1Es', {
      country: ['US'],
      include_groups: ['album'],
    });
    console.log(albums.items.map(album => album.name));
    // Array [ "Beware of the Dogs" ]

    Parameters

    • artistId: string

      The Spotify ID for the artist.

    • Optional options: GetArtistAlbumsOptions

      Optional request information.

    Returns Promise<GetArtistAlbumsResponse>

getArtistTopTracks

  • getArtistTopTracks(artistId: string, country: string): Promise<Track[]>
  • Get Spotify catalog information about an artist's top tracks by country.

    Required Scopes: None.

    example
    const tracks = await spotify.artists.getArtistTopTracks(
      '2h93pZq0e7k5yf4dywlkpM',
      'US',
    );
    console.log(tracks.map(track => track.name));
    // Array [ "Chanel", "Nights", "Ivy", ... ]

    Parameters

    • artistId: string

      The Spotify ID for the artist.

    • country: string

      An ISO 3166-1 alpha-2 country code or the string from_token.

    Returns Promise<Track[]>

getArtists

  • getArtists(artistIds: string[]): Promise<Artist[]>
  • Get Spotify catalog information for several artists based on their Spotify IDs.

    Required Scopes: None.

    example
    const artists = await spotify.artists.getArtists([
      '4iCwCMnqsNZ6atvRiADgtn',
      '6ns6XAOsw4B0nDUIovAOUO',
      '2yQf6b8hxahZaT5dHlWaB1',
    ]);
    console.log(artists.map(artist => artist.name));
    // Array [ "RZA", "GZA", "Raekwon" ]

    Parameters

    • artistIds: string[]

      The Spotify IDs for the artists.

    Returns Promise<Artist[]>

getRelatedArtists

  • getRelatedArtists(artistId: string): Promise<Artist[]>
  • Get Spotify catalog information about artists similar to a given artist. Similarity is based on analysis of the Spotify community's listening history.

    Required Scopes: None.

    example
    const artists = await spotify.artists.getRelatedArtists(
      '6kBDZFXuLrZgHnvmPu9NsG',
    );
    console.log(artists.map(artist => artist.name));
    // Array [ "AFX", "Squarepusher", "Boards of Canada", ... ]

    Parameters

    • artistId: string

      The Spotify ID for the artist.

    Returns Promise<Artist[]>

Generated using TypeDoc