views:

62

answers:

3

I've written a small java program to download all friends' and followers' profile pictures from twitter. But i'm getting an error because only 150 requests per hour per IP address is allowed.

the exact error is:

twitter4j.TwitterException: 400:The request was invalid.  An accompanying error message will explain why. This is the status code will be returned during rate limiting.
<?xml version="1.0" encoding="UTF-8"?>
<hash>
  <request>/users/show/92715794.xml</request>
  <error>Rate limit exceeded. Clients may not make more than 150 requests per hour.</error>
</hash>

Is there a way around this problem...??? Please help...

+1  A: 

Is there a way around this problem...???

Yes. Slow down your process so that it only makes 150 requests per hour.

Gilbert Le Blanc
i can not slow down since i need to download the profile pictures. I could have if i was simply building a twitter client of sorts.
codemaniac
+4  A: 

As a developer you can request whitelisting of your account, raising the limit to 20 000 requests / hours. Read more at http://apiwiki.twitter.com/Rate-limiting

Løkling
Just what I was about to say. +1
RobertPitt
i didn' knew abt this! +1
Rakesh Juyal
thanks Løkling... i filled th form...
codemaniac
A: 

You can either

  1. Get your app whitelisted (20 000 req/h)
  2. Instead of doing unauthenticated requests, authenticate with OAuth (350 req/h)
  3. Slow down you requests

Judging for your description, I don't know if you can expect to get whitelisted. Given that you won't gain to much, implementing OAuth might be not worth the trouble. It seems you are stuck to taking it slow.

Daniel Hepper
Twitter now has OAuth has authentication, BASIC has been deprecated.
The Elite Gentleman
You are right, I clarified my answer.
Daniel Hepper
why can't i expect to get whitelisted..?? what is the criteria...????
codemaniac