403 errors from DO to iTunes API

February 3, 2015 2.1k views

Hi,
I have a rake task that fetches information from Apple's iTunes API.

I'm opening a bunch of URL's in the following format:
https://itunes.apple.com/lookup?id=953290300

There are 50 requests or so similar to this with different id's.

When the task runs, it will complete the first 3 or 4 requests fine, but when then all subsequent requests will crap out with a 403 Forbidden error from Apple.

The same task runs fine on my development machine, no 403 errors. I'm using Ruby's open-uri library on Ruby 2.

Is it possible the DO IP range is somehow being blocked by the iTunes API?

Thanks for your help.

1 comment
  • How quickly are you sending the request. Since the first few complete before you get the 403 it is possible that you are running into some type of rate-limiting on the API. If apple were blocking the IP range outright you would likely see failures on your first requests rather than after a few have completed.

1 Answer

This question was answered by @ryanpq:

How quickly are you sending the request. Since the first few complete before you get the 403 it is possible that you are running into some type of rate-limiting on the API. If apple were blocking the IP range outright you would likely see failures on your first requests rather than after a few have completed.

View the original comment

Have another answer? Share your knowledge.