Musickit Top Results only return 3 items

I've been trying to implement MusicCatalogSearchRequest with includeTopResults. It works. But topResults only returns 3 items. I tried with many different search terms and even compared the same search term with Apple Music app where it gives many more top results.

Below is my code

var searchRequest = MusicCatalogSearchRequest(term: searchTerm,
                            types: [
                             Song.self,
                             MusicVideo.self,
                             Album.self,
                             Playlist.self,
                             Curator.self,
                             RadioShow.self,
                             Artist.self
                            ])
     searchRequest.includeTopResults = true
     searchResponse = try await searchRequest.response()
     print(searchResponse?.topResults)

What should I do to get more relevant top results? Could this be a bug in iOS 16 Beta or is topResults restricted to 3 items in Musickit?

Try the Apple Music API endpoint: https://api.music.apple.com/v1/catalog/us/search?term=weeknd&types=albums,apple-curators,artists,curators,music-videos,playlists,record-labels,songs,stations&with=topResults. It also gives only top results restricted to 3 for some reason, which is weird.

I tried your code and realized that you could get more topResults, but you have to offset them. Increasing the limit did not work. My code:

let types: [MusicCatalogSearchable.Type] = [
 Song.self,
 Artist.self,
 MusicVideo.self,
 Album.self,
 Playlist.self,
 Curator.self,
 RadioShow.self
]

var request = MusicCatalogSearchRequest(term: "weeknd", types: types)
request.includeTopResults = true
var topResults: MusicItemCollection<MusicCatalogSearchResponse.TopResult> = []

for offset in stride(from: 0, through: 15, by: 3) {
 request.offset = offset
 let response = try await request.response()
 topResults += response.topResults
}

print(topResults)

The response is:

MusicItemCollection<MusicCatalogSearchResponse.TopResult>(
 items: [
  TopResult.artist(Artist(id: "479756766", name: "The Weeknd")),
  TopResult.playlist(Playlist(id: "pl.659f6a1cac0f4232ad19d1a2cfdc9fb8", name: "The Weeknd Essentials", curatorName: "Apple Music R&B")),
  TopResult.song(Song(id: "1488408568", title: "Blinding Lights", artistName: "The Weeknd")),
  TopResult.song(Song(id: "1440870397", title: "I Feel It Coming (feat. Daft Punk)", artistName: "The Weeknd")),
  TopResult.album(Album(id: "1603171516", title: "Dawn FM", artistName: "The Weeknd")),
  TopResult.playlist(Playlist(id: "pl.774f9bceb38e45ef8f9f18e389a12160", name: "The Weeknd Video Essentials", curatorName: "Apple Music R&B")),
  TopResult.song(Song(id: "1499378613", title: "Save Your Tears", artistName: "The Weeknd")),
  TopResult.album(Album(id: "1440826239", title: "Beauty Behind the Madness", artistName: "The Weeknd")),
  TopResult.playlist(Playlist(id: "pl.18f95e87b4ad427dba02bc7a79d0a84f", name: "The Weeknd: Influences", curatorName: "Apple Music R&B")),
  TopResult.song(Song(id: "1499378615", title: "After Hours", artistName: "The Weeknd")),
  TopResult.musicVideo(MusicVideo(id: "1579734725", title: "Take My Breath", artistName: "The Weeknd")),

  TopResult.song(Song(id: "1563812775", title: "Save Your Tears (Remix)", artistName: "The Weeknd & Ariana Grande")),
  TopResult.album(Album(id: "1499385848", title: "After Hours", artistName: "The Weeknd")),
  TopResult.musicVideo(MusicVideo(id: "1528431580", title: "Smile", artistName: "Juice WRLD & The Weeknd")),
  TopResult.song(Song(id: "1440870378", title: "Reminder", artistName: "The Weeknd")),
  TopResult.album(Album(id: "1440858094", title: "Beauty Behind the Madness", artistName: "The Weeknd"))
 ]
)

However, with many network calls, this defeats the purpose of topResults, which is meant to get the results for the given search term quickly. There may be a better way to fetch all the top results, and I am all ears to know it.

Musickit Top Results only return 3 items
 
 
Q