Hi Zaver,

A 420 response from the Search API means you have been rate limited. What
you should do is stop making requests and then try again 30 seconds later.
If you still get 420, wait 1 minute. Continue doubling the time you wait
until the 420 stops and you get results. Then gradually increase your
request rate again.

For extra back off magic add a little jitter (e.g. a random number of
seconds between say 0 and 30) to the doubled wait times.

Hope that helps,
@themattharris
Developer Advocate, Twitter
http://twitter.com/themattharris


On Tue, Feb 22, 2011 at 12:29 AM, zaver <zave...@hotmail.com> wrote:

> Hello,
>
> I am using the search api with multiple keywords (120 keywords) using
> curl (curl_multi_init etc.), querying the api every 5 mins and i need
> some help on how to handle some of the response codes.
> Specifically:
>
> 420 -> i get this error on some of my keywords not all. Does this mean
> that i am rate limited and should wait for the amount of time in the
> Retry-after part in general or only for these keywords? Currently I do
> wait for the amount of time it specifies for the whole keyword set. Is
> that right?
>
> Haven't come across these yet although i would like to have some
> handling for these.
>
> 502: Bad Gateway: Twitter is down or being upgraded.
> 503: Service Unavailable: The Twitter servers are up, but overloaded
> with requests. Try again later.
>
> Any help is greatly appreciated. Thanks
>
> Zaver
>
> --
> Twitter developer documentation and resources: http://dev.twitter.com/doc
> API updates via Twitter: http://twitter.com/twitterapi
> Issues/Enhancements Tracker:
> http://code.google.com/p/twitter-api/issues/list
> Change your membership to this group:
> http://groups.google.com/group/twitter-development-talk
>

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk

Reply via email to