Skip to content

Recommendations

API #

Implementation to make API calls with.

Parameters:

get_recommendations #

get_recommendations(seed_artists: MissingOr[list[str]] = MISSING, seed_genres: MissingOr[list[str]] = MISSING, seed_tracks: MissingOr[list[str]] = MISSING, *, limit: MissingOr[int] = MISSING, market: MissingOr[str] = MISSING, min_acousticness: MissingOr[float] = MISSING, max_acousticness: MissingOr[float] = MISSING, target_acousticness: MissingOr[float] = MISSING, min_danceability: MissingOr[float] = MISSING, max_danceability: MissingOr[float] = MISSING, target_danceability: MissingOr[float] = MISSING, min_duration: MissingOr[timedelta] = MISSING, max_duration: MissingOr[timedelta] = MISSING, target_duration: MissingOr[timedelta] = MISSING, min_energy: MissingOr[float] = MISSING, max_energy: MissingOr[float] = MISSING, target_energy: MissingOr[float] = MISSING, min_instrumentalness: MissingOr[float] = MISSING, max_instrumentalness: MissingOr[float] = MISSING, target_instrumentalness: MissingOr[float] = MISSING, min_key: MissingOr[int] = MISSING, max_key: MissingOr[int] = MISSING, target_key: MissingOr[int] = MISSING, min_liveness: MissingOr[float] = MISSING, max_liveness: MissingOr[float] = MISSING, target_liveness: MissingOr[float] = MISSING, min_loudness: MissingOr[float] = MISSING, max_loudness: MissingOr[float] = MISSING, target_loudness: MissingOr[float] = MISSING, min_mode: MissingOr[int] = MISSING, max_mode: MissingOr[int] = MISSING, target_mode: MissingOr[int] = MISSING, min_popularity: MissingOr[int] = MISSING, max_popularity: MissingOr[int] = MISSING, target_popularity: MissingOr[int] = MISSING, min_speechiness: MissingOr[float] = MISSING, max_speechiness: MissingOr[float] = MISSING, target_speechiness: MissingOr[float] = MISSING, min_tempo: MissingOr[float] = MISSING, max_tempo: MissingOr[float] = MISSING, target_tempo: MissingOr[float] = MISSING, min_time_signature: MissingOr[int] = MISSING, max_time_signature: MissingOr[int] = MISSING, target_time_signature: MissingOr[int] = MISSING, min_valence: MissingOr[float] = MISSING, max_valence: MissingOr[float] = MISSING, target_valence: MissingOr[float] = MISSING) -> Recommendations

Get recommendations based on other artists, genres and/or tracks.

Note

One of seed_artists, seed_genres and seed_tracks must be provided. Up to 5 seed values may be provided in any combination of seed_artists, seed_genres and seed_tracks.

Parameters:

  • seed_artists (list[str], default: MISSING ) –

    IDs of seed artists.

  • seed_genres (list[str], default: MISSING ) –

    Seed genres.

  • seed_tracks (list[str], default: MISSING ) –

    IDs of seed tracks.

  • limit (int, default: 20 ) –

    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.

  • market (str, default: MISSING ) –

    Only get content available in that market. Must be an ISO 3166-1 alpha-2 country code.

  • min_acousticness (float, default: MISSING ) –

    Minimum acousticness. Range: 0.0 - 1.0.

  • max_acousticness (float, default: MISSING ) –

    Maximum acousticness. Range: 0.0 - 1.0.

  • target_acousticness (float, default: MISSING ) –

    Target acousticness. Range: 0.0 - 1.0.

  • min_danceability (float, default: MISSING ) –

    Minimum danceability. Range: 0.0 - 1.0.

  • max_danceability (float, default: MISSING ) –

    Maximum danceability. Range: 0.0 - 1.0.

  • target_danceability (float, default: MISSING ) –

    Target danceability. Range: 0.0 - 1.0.

  • min_duration (timedelta, default: MISSING ) –

    Minimum duration.

  • max_duration (timedelta, default: MISSING ) –

    Maximum duration.

  • target_duration (timedelta, default: MISSING ) –

    Target duration.

  • min_energy (float, default: MISSING ) –

    Minimum energy. Range: 0.0 - 1.0.

  • max_energy (float, default: MISSING ) –

    Maximum energy. Range: 0.0 - 1.0.

  • target_energy (float, default: MISSING ) –

    Target energy. Range: 0.0 - 1.0.

  • min_instrumentalness (float, default: MISSING ) –

    Minimum instrumentalness. Range: 0.0 - 1.0.

  • max_instrumentalness (float, default: MISSING ) –

    Maximum instrumentalness. Range: 0.0 - 1.0.

  • target_instrumentalness (float, default: MISSING ) –

    Target instrumentalness. Range: 0.0 - 1.0.

  • min_key (int, default: MISSING ) –

    Minimum key. Range: 0 - 11.

  • max_key (int, default: MISSING ) –

    Maximum instrumentalness. Range: 0 - 11.

  • target_key (int, default: MISSING ) –

    Target instrumentalness. Range: 0 - 11.

  • min_liveness (float, default: MISSING ) –

    Minimum liveness. Range: 0.0 - 1.0.

  • max_liveness (float, default: MISSING ) –

    Maximum liveness. Range: 0.0 - 1.0.

  • target_liveness (float, default: MISSING ) –

    Target liveness. Range: 0.0 - 1.0.

  • min_loudness (float, default: MISSING ) –

    Minimum loudness. Range: 0.0 - 1.0.

  • max_loudness (float, default: MISSING ) –

    Maximum loudness. Range: 0.0 - 1.0.

  • target_loudness (float, default: MISSING ) –

    Target loudness. Range: 0.0 - 1.0.

  • min_mode (int, default: MISSING ) –

    Minimum mode. Range: 0.0 - 1.0.

  • max_mode (int, default: MISSING ) –

    Maximum mode. Range: 0.0 - 1.0.

  • target_mode (int, default: MISSING ) –

    Target mode. Range: 0.0 - 1.0.

  • min_popularity (int, default: MISSING ) –

    Minimum popularity. Range: 0 - 100.

  • max_popularity (int, default: MISSING ) –

    Maximum popularity. Range: 0 - 100.

  • target_popularity (int, default: MISSING ) –

    Target popularity. Range: 0 - 100.

  • min_speechiness (float, default: MISSING ) –

    Minimum speechiness. Range: 0.0 - 1.0.

  • max_speechiness (float, default: MISSING ) –

    Maximum speechiness. Range: 0.0 - 1.0.

  • target_speechiness (float, default: MISSING ) –

    Target speechiness. Range: 0.0 - 1.0.

  • min_tempo (float, default: MISSING ) –

    Minimum tempo.

  • max_tempo (float, default: MISSING ) –

    Maximum tempo.

  • target_tempo (float, default: MISSING ) –

    Target tempo.

  • min_time_signature (int, default: MISSING ) –

    Minimum time signature. Maximum: 11.

  • max_time_signature (int, default: MISSING ) –

    Maximum time signature.

  • target_time_signature (int, default: MISSING ) –

    Target time signature.

  • min_valence (float, default: MISSING ) –

    Minimum valence. Range: 0.0 - 1.0.

  • max_valence (float, default: MISSING ) –

    Maximum valence. Range: 0.0 - 1.0.

  • target_valence (float, default: MISSING ) –

    Target valence. Range: 0.0 - 1.0.

Recommendations #

Recommendations.

seeds #

A list of recommendation seeds.

tracks #

tracks: list[Track]

A list of tracks.

RecommendationSeed #

A recommendation seed.

after_filtering_size #

after_filtering_size: int

The number of tracks available after min and max filters have been applied.

after_relinking_size #

after_relinking_size: int

The number of tracks available after relinking for regional availability.

href #

href: str | None

A link to the full track or artist data for the seed.

  • For tracks this will be a link to a Track object.
  • For artists a link to an Artist object.
  • For genre seeds, this value will be None.

id #

id: str

The id used to select the seed. This will be the same as the string used in the seed_artists, seed_tracks or seed_genres parameter.

initial_pool_size #

initial_pool_size: int

The number of recommended tracks available for the seed.

type #

The entity type of the seed.