How to fetch all albums after performing a library request

Hi,

In my app I am using MusicLibraryRequest<Artist> to fetch all of the artists in someone's Library collection. With this response I then fetch each artists albums: artist.with([.album]).

The response from this only gives albums in the users Library collection. I would like to augment it with all of the albums for an artist from the full catalogue.

I'm using MusicKit and targeting iOS18 and visionOS 2.

Could someone please point me towards the best way to approach this?

Hello @kemalenver, thank you for your post. That is expected, since MusicLibraryRequest fetches items from the user’s music library. To fetch items from the Apple Music catalog, you can use MusicCatalogResourceRequest, for example. Other options include MusicCatalogSearchRequest, the Apple Music Feed, and the Apple Music API. Since you already have an Artist, however, MusicCatalogSearchRequest might be the most straightforward mechanism.

How to fetch all albums after performing a library request
 
 
Q