Updates to iTunes Artwork Finder
Last week, my iTunes Artwork Finder script stopped working due to some changes by Apple with regards to rate limiting. In the past, searching for something on my site would cause my server to send a request to Apple and get the data back but with so many people using it my server would get blocked within a few seconds.
After a brief shutdown1, I’m happy to say that my iTunes Artwork Finder is now back up and running again thanks to a few tweaks. Now, instead of sending all requests from my server, it works like this:
- When you enter a search term (i.e. “Fall out boy” albums in United Kingdom), that is sent to my server where I’ll generate the correct URL that is needed for Apple’s servers
- Your browser then takes that URL to make the request directly to Apple
- When the data is returned from Apple, the browser then sends it to my server for processing
- Results are then displayed!
This means that there are now 3 network requests instead of 1 but the crucial part is that all requests to Apple’s servers are now made from your own browser so the rate limiting shouldn’t be a problem2.
Whilst not an ideal solution, it does work and means I can keep everything running for a bit longer. I’m hopeful that Apple will alter how their rate limiting works as at the moment it seems a bit broken, especially with it being required for several apps with the new Apple Music APIs.
The code for the artwork finder is available on GitHub although this uses the old PHP request system rather than my new version as that should be more than good enough for personal usage3.
If you run into any problems, please get in touch.
-
During which I received around 80 emails hoping that it would come back online - thanks! It’s nice to know that so many people use the site; I have no analytics on my website so seeing so many people get in touch made me realise how big it has become. ↩︎
-
Unless you try and do around 50 searches in short succession in which case you’ll need to wait a bit before you can make more requests. ↩︎
-
And if you want to do more than just personal usage you should speak to me first as I don’t really want people to create entire duplicates of my own project. ↩︎