Why is Twitter API returning 400 errors in production?

I have a Twitter app that works fantastically locally - it looks up keywords and then for each user it grabs its information with Hpricot to parse the xml for example.

Hpricot(open("http://twitter.com/users/show/"+myuser+".xml"))

Works fine locally but when I go love fails. Looking at my log I am getting this error:

OpenURI::HTTPError (400 Bad Request):

Strange, but sometimes it works.

It was a recurring problem for several days and gave me nuts. I will hug someone with a solution :)

+2


source to share


2 answers


It's almost definitely a rate limit - http://apiwiki.twitter.com/HTTP-Response-Codes-and-Errors . Haven't seen the 400s returned for anything other than the speed limit before, although the docs say there might be an accompanying message that tells you more precisely what is wrong.



You may be able to whitelist for more requests, see http://twitter.com/help/request_whitelisting .

+2


source


You are probably making too many requests. You are allowed to make 150 unauthenticated REST API calls per hour.



REST API rate limiting

  • Unauthorized calls allowed 150 requests per hour. Unauthorized calls are measured against the public IP address of the server or device making the request.
  • OAuth calls allow 350 requests per hour and are measured against the oauth_token used in the request.
+1


source







All Articles