Rate Limit Status

rate-limits

#1

Hello!

My java application was a bug in your routine and executed a long search. The bug was fixed, but by now I can not work anymore, because it always returns the following message:

TwitterException{exceptionCode=[d19a9b74-77171cfc], statusCode=429, message=Rate limit exceeded, code=88, retryAfter=-1, rateLimitStatus=RateLimitStatusJSONImpl{remaining=0, limit=180, resetTimeInSeconds=1472137489, secondsUntilReset=501}, version=4.0.3}

Help! What should I do?


#2

This is twitter4j right? Make sure you catch that TwitterException, and wait an appropriate time and try again later.

If you catch the exception, it will have a exception.getRateLimitStatus().getSecondsUntilReset() - that tells you how many seconds to wait - but i’d wait a few extra seconds on top of that just to make sure that it reset.