views:

108

answers:

2

Hi - I have recently noticed that I keep getting a 403 error while doing twitter search. My application was working until couple of days back when i noticed the error.

I checked with Twitter & they say my IP is not blocked, I am also within the rate limit = about 60 search requests/per hour.

Here's how i was initializing the Twitter object -

private static Twitter TWITTER_CLIENT = new TwitterFactory().getInstance();

After i noticed the error, i tried the following & still no success -

private static Twitter TWITTER_CLIENT = new TwitterFactory().getInstance("user", "password");

Here's how i am searching -

TWITTER_CLIENT.search(new Query("#keyword1 OR #keyword2"));

I tried this URL (curl http://search.twitter.com/search.json?q=ipad) from my server & it works alright.

Following is the exception. I am on java6 + Twitter4j v2.1.2. Would really appreciate any help. Thanks.

TwitterException{statusCode=403, retryAfter=0, rateLimitStatus=null}
    at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:301)
    at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:68)
    at twitter4j.internal.http.HttpClientWrapper.get(HttpClientWrapper.java:82)
    at twitter4j.Twitter.search(Twitter.java:193)
A: 

Most likely the reason is basic auth shutdown by Twitter (aka OAuthcalypse):

Basic Auth Shutdown

You need to switch to using OAuth.

Shcheklein
A: 

hi user310525, Have you got any solution regarding this problem (status =403), I am also facing same even message twit or not.

Please suggest me if u got any solution.

Thanks

Shubh
this is known issue with twitter - http://code.google.com/p/twitter-api/issues/detail?id=1863