Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search iTunes by artist and song title

Tags:

itunes

I found that I can search for a song term like so:

https://itunes.apple.com/search?media=music&entity=musicTrack&attribute=songTerm&term=xxxx

But what I really want to do is search by song title and the artist. I can't seem to find syntax that would allow for that. Is it possible? I'm doing this from inside an iOS audio streaming application so I want to keep the returned results as small as possible so as to not use up much of a person's data plan.

like image 214
Gargoyle Avatar asked Oct 21 '22 19:10

Gargoyle


1 Answers

Basically itunes search api sucks, a lot. I was trying to do the same, but there isn't a direct way to search by song and artist, it searches both, and if your user misspelled the name of the song or the artist, the search can give you bad results.

So my solution was basically use a prefilter first to correct that, using echonest, to search by artist name and song name, then show a dropdown (you can choose other method like "Do you mean: ...?" with links to correct url for search) and then use what Fahad says, putting first the name of the artist and then the name of the song. Don't forget to encode those.

like image 110
Franco Risso Avatar answered Jan 02 '23 20:01

Franco Risso