Class: Spotted::Resources::Recommendations
- Inherits:
-
Object
- Object
- Spotted::Resources::Recommendations
- Defined in:
- lib/spotted/resources/recommendations.rb
Instance Method Summary collapse
- #get(limit: nil, market: nil, max_acousticness: nil, max_danceability: nil, max_duration_ms: nil, max_energy: nil, max_instrumentalness: nil, max_key: nil, max_liveness: nil, max_loudness: nil, max_mode: nil, max_popularity: nil, max_speechiness: nil, max_tempo: nil, max_time_signature: nil, max_valence: nil, min_acousticness: nil, min_danceability: nil, min_duration_ms: nil, min_energy: nil, min_instrumentalness: nil, min_key: nil, min_liveness: nil, min_loudness: nil, min_mode: nil, min_popularity: nil, min_speechiness: nil, min_tempo: nil, min_time_signature: nil, min_valence: nil, seed_artists: nil, seed_genres: nil, seed_tracks: nil, target_acousticness: nil, target_danceability: nil, target_duration_ms: nil, target_energy: nil, target_instrumentalness: nil, target_key: nil, target_liveness: nil, target_loudness: nil, target_mode: nil, target_popularity: nil, target_speechiness: nil, target_tempo: nil, target_time_signature: nil, target_valence: nil, request_options: {}) ⇒ Spotted::Models::RecommendationGetResponse deprecated Deprecated.
-
#initialize(client:) ⇒ Recommendations
constructor
private
A new instance of Recommendations.
- #list_available_genre_seeds(request_options: {}) ⇒ Spotted::Models::RecommendationListAvailableGenreSeedsResponse deprecated Deprecated.
Constructor Details
#initialize(client:) ⇒ Recommendations
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 Recommendations.
155 156 157 |
# File 'lib/spotted/resources/recommendations.rb', line 155 def initialize(client:) @client = client end |
Instance Method Details
#get(limit: nil, market: nil, max_acousticness: nil, max_danceability: nil, max_duration_ms: nil, max_energy: nil, max_instrumentalness: nil, max_key: nil, max_liveness: nil, max_loudness: nil, max_mode: nil, max_popularity: nil, max_speechiness: nil, max_tempo: nil, max_time_signature: nil, max_valence: nil, min_acousticness: nil, min_danceability: nil, min_duration_ms: nil, min_energy: nil, min_instrumentalness: nil, min_key: nil, min_liveness: nil, min_loudness: nil, min_mode: nil, min_popularity: nil, min_speechiness: nil, min_tempo: nil, min_time_signature: nil, min_valence: nil, seed_artists: nil, seed_genres: nil, seed_tracks: nil, target_acousticness: nil, target_danceability: nil, target_duration_ms: nil, target_energy: nil, target_instrumentalness: nil, target_key: nil, target_liveness: nil, target_loudness: nil, target_mode: nil, target_popularity: nil, target_speechiness: nil, target_tempo: nil, target_time_signature: nil, target_valence: nil, request_options: {}) ⇒ Spotted::Models::RecommendationGetResponse
Some parameter documentations has been truncated, see Models::RecommendationGetParams for more details.
Recommendations are generated based on the available information for a given seed entity and matched against similar artists and tracks. If there is sufficient information about the provided seeds, a list of tracks will be returned together with pool size details.
For artists and tracks that are very new or obscure there might not be enough data to generate a list of tracks.
120 121 122 123 124 125 126 127 128 129 |
# File 'lib/spotted/resources/recommendations.rb', line 120 def get(params = {}) parsed, = Spotted::RecommendationGetParams.dump_request(params) @client.request( method: :get, path: "recommendations", query: parsed, model: Spotted::Models::RecommendationGetResponse, options: ) end |
#list_available_genre_seeds(request_options: {}) ⇒ Spotted::Models::RecommendationListAvailableGenreSeedsResponse
Retrieve a list of available genres seed parameter values for [recommendations](/documentation/web-api/reference/get-recommendations).
143 144 145 146 147 148 149 150 |
# File 'lib/spotted/resources/recommendations.rb', line 143 def list_available_genre_seeds(params = {}) @client.request( method: :get, path: "recommendations/available-genre-seeds", model: Spotted::Models::RecommendationListAvailableGenreSeedsResponse, options: params[:request_options] ) end |