Rate limit Status for followers / friendships

friendships
following

#1

Hi There,
I just want to know rate limit end point for few actions like to follow a user, to get know the relationship of a user with my app and unfollow user for all these action rate limit was there but i didn’t found any where the end point .I am using Twitter4J implementation for my app, there to get the user relationship they are using lookupFriendships() method and This method calls https://api.twitter.com/1.1/friendships/lookup.json

is there any way to handle it, can anybody help me out this


#3

Following and unfollowing are both POST operations, so these are account limits, not application rate limits.


#4

Thank you for info but my major problem was there is a rate limit to get know the relationship of a user with my app. To get the relationship status i am using lookupFriendships() method and This method calls https://api.twitter.com/1.1/friendships/lookup.json in Twitter4J. My use case was if i have 200 users and i am trying to check the relationship status with my app, upto 15 users it was very fine after 15 users it was getting exception like rate limit was exceeded. How to get the rate limit and handle that one
Can I get any alternate for this, any suggestions please…


#5

Apologies for my confusion with your first post, you mentioned following and unfollowing so I wasn’t sure which endpoint you were asking about.

Yes, that would be the case as friendships/lookup is limited to 15 calls in a 15 minute window. Note that with friendships/lookup you can pass in a comma separated list of up to 100 users at a time, which may help with batch lookups.

If you’re able to use friendships/show instead, the rate rises to 180 calls in a 15 minute window (with user authentication), however this works on a 1:1 basis.

Other than that, with users with large followings, this will take a while. My only advice would be to manage your use of the API, cache your results for later usage, and expect to work within the rate limits.


#7

Thank you for your info it helps me, I found some weird behaviour with friendships/show, the docs were mentioned this will have rate as 180 calls in a 15 minute window (with user authentication) and i am getting this rate limit object RateLimitStatusJSONImpl{remaining=105, limit=180, resetTimeInSeconds=1515497351, secondsUntilReset=600} while fetching the ratelimit object by using the end point which provided by the API docs. upto 75 user it was very fine after 75 users it was getting exception like rate limit was exceeded in that exception i found the rate limit object as TwitterException{exceptionCode=[9a9caf7a-bf94ba05], statusCode=429, message=Rate limit exceeded, code=88, retryAfter=-1, rateLimitStatus=RateLimitStatusJSONImpl{remaining=0, limit=75, resetTimeInSeconds=1515496325, secondsUntilReset=594}, version=4.0.6} .

is this bug or any thing i missed out, I didn’t understood why it was happening???


#8

It looks like you’re calling two separate endpoints to see that result, since they show limits of 180 and of 75.


#9

No no i am not using two separate methods. Only one method i am using with that end point that is 180 one. In exception i got that message that’s what i mentioned in the above post, after completing of 75 user the rate limit remaining is 105 still, so i tried to call showFriendship() method at that time i found exception message as this

Twitter Exception
429:Returned in API v1.1 when a request cannot be served due to the application's rate limit having been exhausted for the resource. See Rate Limiting in API v1.1.(https://dev.twitter.com/docs/rate-limiting/1.1)
message - Rate limit exceeded
code - 88

Relevant discussions can be found on the Internet at:
	http://www.google.co.jp/search?q=9a9caf7a or
	http://www.google.co.jp/search?q=bf94ba05
TwitterException{exceptionCode=[9a9caf7a-bf94ba05], statusCode=429, message=Rate limit exceeded, code=88, retryAfter=-1, rateLimitStatus=RateLimitStatusJSONImpl{remaining=0, limit=75, resetTimeInSeconds=1515496325, secondsUntilReset=594}, version=4.0.6}
	at twitter4j.HttpClientImpl.handleRequest(HttpClientImpl.java:164)
	at twitter4j.HttpClientBase.request(HttpClientBase.java:57)
	at twitter4j.HttpClientBase.get(HttpClientBase.java:75)

in this exception message i found the rate limit object limit as 75, usually it should be 180


#10

I’ve just run a loop using twurl and called friendships/show 180 times before hitting the rate limit ceiling. At no point did the x-rate-limit HTTP header switch from 180 to 75. Something strange is happening in the Twitter4J code as the Twitter API is operating as expected.


#11

i am also doing the same called friendships/show in loop but after 76th time i got exception, is there any way to overcome this


#12

This is a Twitter4J issue - I’m unable to reproduce using raw API calls.


#13

Ok. Thank you for the effort.