How to get the music MusicItemID of the specific song ?

Hi, . As my understading, I know that id: MusicItemID The unique identifier for the song. Threfore, I want to try to retreive the specific song I want by using MusicItemID :

let request = MusicCatalogResourceRequest<Song>(matching: \.id,
equalTo: //MusicItemID)

let response = try await request.response()

guard let song = response.items.first else { return }

However, where can I find the MusicItemID for the song I want ? Thank you so much

Replies

You can use the MusicCatalogSearchRequest to search for the song for which you want the MusicItemID for and then use the MusicCatalogResourceRequest<Song>() to get more detailed data about the particular song.

@snuff4 I read many of your answers related to Music and I need a bit of help with my app, can we connect by any chance please? LinkedIn Loyal El Mir