Class GetRecommendationsRequest

java.lang.Object
de.sonallux.spotify.api.apis.tracks.GetRecommendationsRequest

public class GetRecommendationsRequest extends Object

Get Recommendations request

Response

A set of recommendations

  • Constructor Details

    • GetRecommendationsRequest

      public GetRecommendationsRequest(ApiClient apiClient)
      Get Recommendations request
      Parameters:
      apiClient -

      The API client

  • Method Details

    • limit

      public GetRecommendationsRequest limit(int limit)
      Parameters:
      limit -

      The target size of the list of recommended tracks. For seeds with unusually small pools or when highly restrictive filtering is applied, it may be impossible to generate the requested number of recommended tracks. Debugging information for such cases is available in the response. Default: 20. Minimum: 1. Maximum: 100.

      Returns:
      this request
    • market

      public GetRecommendationsRequest market(String market)
      Parameters:
      market -

      An ISO 3166-1 alpha-2 country code. If a country code is specified, only content that is available in that market will be returned.
      If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter.
      Note: If neither market or user country are provided, the content is considered unavailable for the client.
      Users can view the country that is associated with their account in the account settings.

      Returns:
      this request
    • seedArtists

      public GetRecommendationsRequest seedArtists(String seedArtists)
      Parameters:
      seedArtists -

      A comma separated list of Spotify IDs for seed artists. Up to 5 seed values may be provided in any combination of seed_artists, seed_tracks and seed_genres.

      Returns:
      this request
    • seedGenres

      public GetRecommendationsRequest seedGenres(String seedGenres)
      Parameters:
      seedGenres -

      A comma separated list of any genres in the set of available genre seeds. Up to 5 seed values may be provided in any combination of seed_artists, seed_tracks and seed_genres.

      Returns:
      this request
    • seedTracks

      public GetRecommendationsRequest seedTracks(String seedTracks)
      Parameters:
      seedTracks -

      A comma separated list of Spotify IDs for a seed track. Up to 5 seed values may be provided in any combination of seed_artists, seed_tracks and seed_genres.

      Returns:
      this request
    • minAcousticness

      public GetRecommendationsRequest minAcousticness(float minAcousticness)
      Parameters:
      minAcousticness -

      For each tunable track attribute, a hard floor on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, min_tempo=140 would restrict results to only those tracks with a tempo of greater than 140 beats per minute.

      Returns:
      this request
    • maxAcousticness

      public GetRecommendationsRequest maxAcousticness(float maxAcousticness)
      Parameters:
      maxAcousticness -

      For each tunable track attribute, a hard ceiling on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, max_instrumentalness=0.35 would filter out most tracks that are likely to be instrumental.

      Returns:
      this request
    • targetAcousticness

      public GetRecommendationsRequest targetAcousticness(float targetAcousticness)
      Parameters:
      targetAcousticness -

      For each of the tunable track attributes (below) a target value may be provided. Tracks with the attribute values nearest to the target values will be preferred. For example, you might request target_energy=0.6 and target_danceability=0.8. All target values will be weighed equally in ranking results.

      Returns:
      this request
    • minDanceability

      public GetRecommendationsRequest minDanceability(float minDanceability)
      Parameters:
      minDanceability -

      For each tunable track attribute, a hard floor on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, min_tempo=140 would restrict results to only those tracks with a tempo of greater than 140 beats per minute.

      Returns:
      this request
    • maxDanceability

      public GetRecommendationsRequest maxDanceability(float maxDanceability)
      Parameters:
      maxDanceability -

      For each tunable track attribute, a hard ceiling on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, max_instrumentalness=0.35 would filter out most tracks that are likely to be instrumental.

      Returns:
      this request
    • targetDanceability

      public GetRecommendationsRequest targetDanceability(float targetDanceability)
      Parameters:
      targetDanceability -

      For each of the tunable track attributes (below) a target value may be provided. Tracks with the attribute values nearest to the target values will be preferred. For example, you might request target_energy=0.6 and target_danceability=0.8. All target values will be weighed equally in ranking results.

      Returns:
      this request
    • minDurationMs

      public GetRecommendationsRequest minDurationMs(int minDurationMs)
      Parameters:
      minDurationMs -

      For each tunable track attribute, a hard floor on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, min_tempo=140 would restrict results to only those tracks with a tempo of greater than 140 beats per minute.

      Returns:
      this request
    • maxDurationMs

      public GetRecommendationsRequest maxDurationMs(int maxDurationMs)
      Parameters:
      maxDurationMs -

      For each tunable track attribute, a hard ceiling on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, max_instrumentalness=0.35 would filter out most tracks that are likely to be instrumental.

      Returns:
      this request
    • targetDurationMs

      public GetRecommendationsRequest targetDurationMs(int targetDurationMs)
      Parameters:
      targetDurationMs -

      Target duration of the track (ms)

      Returns:
      this request
    • minEnergy

      public GetRecommendationsRequest minEnergy(float minEnergy)
      Parameters:
      minEnergy -

      For each tunable track attribute, a hard floor on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, min_tempo=140 would restrict results to only those tracks with a tempo of greater than 140 beats per minute.

      Returns:
      this request
    • maxEnergy

      public GetRecommendationsRequest maxEnergy(float maxEnergy)
      Parameters:
      maxEnergy -

      For each tunable track attribute, a hard ceiling on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, max_instrumentalness=0.35 would filter out most tracks that are likely to be instrumental.

      Returns:
      this request
    • targetEnergy

      public GetRecommendationsRequest targetEnergy(float targetEnergy)
      Parameters:
      targetEnergy -

      For each of the tunable track attributes (below) a target value may be provided. Tracks with the attribute values nearest to the target values will be preferred. For example, you might request target_energy=0.6 and target_danceability=0.8. All target values will be weighed equally in ranking results.

      Returns:
      this request
    • minInstrumentalness

      public GetRecommendationsRequest minInstrumentalness(float minInstrumentalness)
      Parameters:
      minInstrumentalness -

      For each tunable track attribute, a hard floor on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, min_tempo=140 would restrict results to only those tracks with a tempo of greater than 140 beats per minute.

      Returns:
      this request
    • maxInstrumentalness

      public GetRecommendationsRequest maxInstrumentalness(float maxInstrumentalness)
      Parameters:
      maxInstrumentalness -

      For each tunable track attribute, a hard ceiling on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, max_instrumentalness=0.35 would filter out most tracks that are likely to be instrumental.

      Returns:
      this request
    • targetInstrumentalness

      public GetRecommendationsRequest targetInstrumentalness(float targetInstrumentalness)
      Parameters:
      targetInstrumentalness -

      For each of the tunable track attributes (below) a target value may be provided. Tracks with the attribute values nearest to the target values will be preferred. For example, you might request target_energy=0.6 and target_danceability=0.8. All target values will be weighed equally in ranking results.

      Returns:
      this request
    • minKey

      public GetRecommendationsRequest minKey(int minKey)
      Parameters:
      minKey -

      For each tunable track attribute, a hard floor on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, min_tempo=140 would restrict results to only those tracks with a tempo of greater than 140 beats per minute.

      Returns:
      this request
    • maxKey

      public GetRecommendationsRequest maxKey(int maxKey)
      Parameters:
      maxKey -

      For each tunable track attribute, a hard ceiling on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, max_instrumentalness=0.35 would filter out most tracks that are likely to be instrumental.

      Returns:
      this request
    • targetKey

      public GetRecommendationsRequest targetKey(int targetKey)
      Parameters:
      targetKey -

      For each of the tunable track attributes (below) a target value may be provided. Tracks with the attribute values nearest to the target values will be preferred. For example, you might request target_energy=0.6 and target_danceability=0.8. All target values will be weighed equally in ranking results.

      Returns:
      this request
    • minLiveness

      public GetRecommendationsRequest minLiveness(float minLiveness)
      Parameters:
      minLiveness -

      For each tunable track attribute, a hard floor on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, min_tempo=140 would restrict results to only those tracks with a tempo of greater than 140 beats per minute.

      Returns:
      this request
    • maxLiveness

      public GetRecommendationsRequest maxLiveness(float maxLiveness)
      Parameters:
      maxLiveness -

      For each tunable track attribute, a hard ceiling on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, max_instrumentalness=0.35 would filter out most tracks that are likely to be instrumental.

      Returns:
      this request
    • targetLiveness

      public GetRecommendationsRequest targetLiveness(float targetLiveness)
      Parameters:
      targetLiveness -

      For each of the tunable track attributes (below) a target value may be provided. Tracks with the attribute values nearest to the target values will be preferred. For example, you might request target_energy=0.6 and target_danceability=0.8. All target values will be weighed equally in ranking results.

      Returns:
      this request
    • minLoudness

      public GetRecommendationsRequest minLoudness(float minLoudness)
      Parameters:
      minLoudness -

      For each tunable track attribute, a hard floor on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, min_tempo=140 would restrict results to only those tracks with a tempo of greater than 140 beats per minute.

      Returns:
      this request
    • maxLoudness

      public GetRecommendationsRequest maxLoudness(float maxLoudness)
      Parameters:
      maxLoudness -

      For each tunable track attribute, a hard ceiling on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, max_instrumentalness=0.35 would filter out most tracks that are likely to be instrumental.

      Returns:
      this request
    • targetLoudness

      public GetRecommendationsRequest targetLoudness(float targetLoudness)
      Parameters:
      targetLoudness -

      For each of the tunable track attributes (below) a target value may be provided. Tracks with the attribute values nearest to the target values will be preferred. For example, you might request target_energy=0.6 and target_danceability=0.8. All target values will be weighed equally in ranking results.

      Returns:
      this request
    • minMode

      public GetRecommendationsRequest minMode(int minMode)
      Parameters:
      minMode -

      For each tunable track attribute, a hard floor on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, min_tempo=140 would restrict results to only those tracks with a tempo of greater than 140 beats per minute.

      Returns:
      this request
    • maxMode

      public GetRecommendationsRequest maxMode(int maxMode)
      Parameters:
      maxMode -

      For each tunable track attribute, a hard ceiling on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, max_instrumentalness=0.35 would filter out most tracks that are likely to be instrumental.

      Returns:
      this request
    • targetMode

      public GetRecommendationsRequest targetMode(int targetMode)
      Parameters:
      targetMode -

      For each of the tunable track attributes (below) a target value may be provided. Tracks with the attribute values nearest to the target values will be preferred. For example, you might request target_energy=0.6 and target_danceability=0.8. All target values will be weighed equally in ranking results.

      Returns:
      this request
    • minPopularity

      public GetRecommendationsRequest minPopularity(int minPopularity)
      Parameters:
      minPopularity -

      For each tunable track attribute, a hard floor on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, min_tempo=140 would restrict results to only those tracks with a tempo of greater than 140 beats per minute.

      Returns:
      this request
    • maxPopularity

      public GetRecommendationsRequest maxPopularity(int maxPopularity)
      Parameters:
      maxPopularity -

      For each tunable track attribute, a hard ceiling on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, max_instrumentalness=0.35 would filter out most tracks that are likely to be instrumental.

      Returns:
      this request
    • targetPopularity

      public GetRecommendationsRequest targetPopularity(int targetPopularity)
      Parameters:
      targetPopularity -

      For each of the tunable track attributes (below) a target value may be provided. Tracks with the attribute values nearest to the target values will be preferred. For example, you might request target_energy=0.6 and target_danceability=0.8. All target values will be weighed equally in ranking results.

      Returns:
      this request
    • minSpeechiness

      public GetRecommendationsRequest minSpeechiness(float minSpeechiness)
      Parameters:
      minSpeechiness -

      For each tunable track attribute, a hard floor on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, min_tempo=140 would restrict results to only those tracks with a tempo of greater than 140 beats per minute.

      Returns:
      this request
    • maxSpeechiness

      public GetRecommendationsRequest maxSpeechiness(float maxSpeechiness)
      Parameters:
      maxSpeechiness -

      For each tunable track attribute, a hard ceiling on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, max_instrumentalness=0.35 would filter out most tracks that are likely to be instrumental.

      Returns:
      this request
    • targetSpeechiness

      public GetRecommendationsRequest targetSpeechiness(float targetSpeechiness)
      Parameters:
      targetSpeechiness -

      For each of the tunable track attributes (below) a target value may be provided. Tracks with the attribute values nearest to the target values will be preferred. For example, you might request target_energy=0.6 and target_danceability=0.8. All target values will be weighed equally in ranking results.

      Returns:
      this request
    • minTempo

      public GetRecommendationsRequest minTempo(float minTempo)
      Parameters:
      minTempo -

      For each tunable track attribute, a hard floor on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, min_tempo=140 would restrict results to only those tracks with a tempo of greater than 140 beats per minute.

      Returns:
      this request
    • maxTempo

      public GetRecommendationsRequest maxTempo(float maxTempo)
      Parameters:
      maxTempo -

      For each tunable track attribute, a hard ceiling on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, max_instrumentalness=0.35 would filter out most tracks that are likely to be instrumental.

      Returns:
      this request
    • targetTempo

      public GetRecommendationsRequest targetTempo(float targetTempo)
      Parameters:
      targetTempo -

      Target tempo (BPM)

      Returns:
      this request
    • minTimeSignature

      public GetRecommendationsRequest minTimeSignature(int minTimeSignature)
      Parameters:
      minTimeSignature -

      For each tunable track attribute, a hard floor on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, min_tempo=140 would restrict results to only those tracks with a tempo of greater than 140 beats per minute.

      Returns:
      this request
    • maxTimeSignature

      public GetRecommendationsRequest maxTimeSignature(int maxTimeSignature)
      Parameters:
      maxTimeSignature -

      For each tunable track attribute, a hard ceiling on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, max_instrumentalness=0.35 would filter out most tracks that are likely to be instrumental.

      Returns:
      this request
    • targetTimeSignature

      public GetRecommendationsRequest targetTimeSignature(int targetTimeSignature)
      Parameters:
      targetTimeSignature -

      For each of the tunable track attributes (below) a target value may be provided. Tracks with the attribute values nearest to the target values will be preferred. For example, you might request target_energy=0.6 and target_danceability=0.8. All target values will be weighed equally in ranking results.

      Returns:
      this request
    • minValence

      public GetRecommendationsRequest minValence(float minValence)
      Parameters:
      minValence -

      For each tunable track attribute, a hard floor on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, min_tempo=140 would restrict results to only those tracks with a tempo of greater than 140 beats per minute.

      Returns:
      this request
    • maxValence

      public GetRecommendationsRequest maxValence(float maxValence)
      Parameters:
      maxValence -

      For each tunable track attribute, a hard ceiling on the selected track attribute’s value can be provided. See tunable track attributes below for the list of available options. For example, max_instrumentalness=0.35 would filter out most tracks that are likely to be instrumental.

      Returns:
      this request
    • targetValence

      public GetRecommendationsRequest targetValence(float targetValence)
      Parameters:
      targetValence -

      For each of the tunable track attributes (below) a target value may be provided. Tracks with the attribute values nearest to the target values will be preferred. For example, you might request target_energy=0.6 and target_danceability=0.8. All target values will be weighed equally in ranking results.

      Returns:
      this request
    • build

      public ApiCall<Recommendations> build()
      Build the request into an executable api call
      Returns:
      an executable api call