getTrackRecommendations

suspend fun getTrackRecommendations(seedArtists: List<String>? = null, seedGenres: List<String>? = null, seedTracks: List<String>? = null, limit: Int? = api.spotifyApiOptions.defaultLimit, market: Market? = null, targetAttributes: List<TrackAttribute<*>> = listOf(), minAttributes: List<TrackAttribute<*>> = listOf(), maxAttributes: List<TrackAttribute<*>> = listOf()): RecommendationResponse(source)

Create a playlist-style listening experience based on seed artists, tracks and genres. 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.

5 seeds of any combination of seedArtists, seedGenres, and seedTracks can be provided. AT LEAST 1 seed must be provided.

All attributes are weighted equally.

See here for a list and descriptions of tuneable track attributes and their ranges.

Api Reference

Return

RecommendationResponse with RecommendationSeeds used and SimpleTracks found

Parameters

seedArtists

A possibly null provided list of Artist IDs to be used to generate recommendations

seedGenres

A possibly null provided list of Genre IDs to be used to generate recommendations. Invalid genres are ignored

seedTracks

A possibly null provided list of Track IDs to be used to generate recommendations

limit

The number of objects to return. Default: 50 (or api limit). Minimum: 1. Maximum: 50.

market

Provide this parameter if you want the list of returned items to be relevant to a particular country. If omitted, the returned items will be relevant to all countries.

targetAttributes

For each of the tunable track attributes a target value may be provided. Tracks with the attribute values nearest to the target values will be preferred.

minAttributes

For each tunable track attribute, a hard floor on the selected track attribute’s value can be provided.

maxAttributes

For each tunable track attribute, a hard ceiling on the selected track attribute’s value can be provided. For example, setting max instrumentalness equal to 0.35 would filter out most tracks that are likely to be instrumental.

Throws

if any filter is applied illegally