Class: Spotted::Resources::Artists

Inherits:
Object
  • Object
show all
Defined in:
lib/spotted/resources/artists.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Artists

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Artists.

Parameters:



149
150
151
# File 'lib/spotted/resources/artists.rb', line 149

def initialize(client:)
  @client = client
end

Instance Method Details

#bulk_retrieve(ids:, request_options: {}) ⇒ Spotted::Models::ArtistBulkRetrieveResponse

Deprecated.

Some parameter documentations has been truncated, see Models::ArtistBulkRetrieveParams for more details.

Get Spotify catalog information for several artists based on their Spotify IDs.

Parameters:

  • ids (String)

    A comma-separated list of the [Spotify IDs](/documentation/web-api/concepts/spot

  • request_options (Spotted::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



46
47
48
49
50
51
52
53
54
55
# File 'lib/spotted/resources/artists.rb', line 46

def bulk_retrieve(params)
  parsed, options = Spotted::ArtistBulkRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: "artists",
    query: parsed,
    model: Spotted::Models::ArtistBulkRetrieveResponse,
    options: options
  )
end

#list_albums(id, include_groups: nil, limit: nil, market: nil, offset: nil, request_options: {}) ⇒ Spotted::Internal::CursorURLPage<Spotted::Models::ArtistListAlbumsResponse>

Some parameter documentations has been truncated, see Models::ArtistListAlbumsParams for more details.

Get Spotify catalog information about an artist’s albums.

Parameters:

  • id (String)

    The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) of the artist

  • include_groups (String)

    A comma-separated list of keywords that will be used to filter the response. If

  • limit (Integer)

    The maximum number of items to return. Default: 5. Minimum: 1. Maximum: 10.

  • market (String)

    An [ISO 3166-1 alpha-2 country code](en.wikipedia.org/wiki/ISO_3166-1_al

  • offset (Integer)

    The index of the first item to return. Default: 0 (the first item). Use with lim

  • request_options (Spotted::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



79
80
81
82
83
84
85
86
87
88
89
# File 'lib/spotted/resources/artists.rb', line 79

def list_albums(id, params = {})
  parsed, options = Spotted::ArtistListAlbumsParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["artists/%1$s/albums", id],
    query: parsed,
    page: Spotted::Internal::CursorURLPage,
    model: Spotted::Models::ArtistListAlbumsResponse,
    options: options
  )
end
Deprecated.

Some parameter documentations has been truncated, see Models::ArtistListRelatedArtistsParams for more details.

Get Spotify catalog information about artists similar to a given artist. Similarity is based on analysis of the Spotify community’s listening history.

Parameters:

  • id (String)

    The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) of the artist

  • request_options (Spotted::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



108
109
110
111
112
113
114
115
# File 'lib/spotted/resources/artists.rb', line 108

def list_related_artists(id, params = {})
  @client.request(
    method: :get,
    path: ["artists/%1$s/related-artists", id],
    model: Spotted::Models::ArtistListRelatedArtistsResponse,
    options: params[:request_options]
  )
end

#retrieve(id, request_options: {}) ⇒ Spotted::Models::ArtistObject

Some parameter documentations has been truncated, see Models::ArtistRetrieveParams for more details.

Get Spotify catalog information for a single artist identified by their unique Spotify ID.

Parameters:

  • id (String)

    The [Spotify ID](/documentation/web-api/concepts/spotify-uris-ids) of the artist

  • request_options (Spotted::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



21
22
23
24
25
26
27
28
# File 'lib/spotted/resources/artists.rb', line 21

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["artists/%1$s", id],
    model: Spotted::ArtistObject,
    options: params[:request_options]
  )
end

#top_tracks(id, market: nil, request_options: {}) ⇒ Spotted::Models::ArtistTopTracksResponse

Deprecated.

Some parameter documentations has been truncated, see Models::ArtistTopTracksParams for more details.

Get Spotify catalog information about an artist’s top tracks by country.

Parameters:

Returns:

See Also:



135
136
137
138
139
140
141
142
143
144
# File 'lib/spotted/resources/artists.rb', line 135

def top_tracks(id, params = {})
  parsed, options = Spotted::ArtistTopTracksParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["artists/%1$s/top-tracks", id],
    query: parsed,
    model: Spotted::Models::ArtistTopTracksResponse,
    options: options
  )
end