how to user apple music api to search by song name, artist name, and album name?

In my app I am able to fetch a MPMediaItem from the user iPod library. I need to search the Apple Music store for the URL to purchase the song. Is there a way to use the search api search using song name, album and artistname I get from the MPMediaItem.


It seems like the the search term can only be one of the 3 search criteria.


I could search using the song name and the scan the potential mountain of results my self to find records that match the album and artist. Seem like this is a good thing to push back to the server


For example


'https://api.music.apple.com/v1/catalog/us/search?term=caldonia&types=songs'


returns 5 results imagine how many results you get back if the search term was love.


i tried using term=songName,artistName&type=songs,artists


how ever I do not get any results back


Its not the end of the world If I had to do this search my self.


Andy

I would recommend using term=songName+artistName+albumName&type=songs and then filtering the results.

how to user apple music api to search by song name, artist name, and album name?
 
 
Q