15

I want to user Search API for twitter using 1.1 version.

There is a limit for 450 request per applications.

But I have a doubt in this rate limiting. I thought that it means we can make 450 request in every 15 mins of request window.

But I read(but i am not sure about what exactly i read) something like by default it returns 15 status based on search query. But if you query more status in single request it's considered based on the number of statuses.

Do they have a rate limit only for every 15 mins or they have rate limit for a day too?

So I couldn't understand how it exactly works ? Can any one help me with this?

David
  • 19,577
  • 28
  • 108
  • 128
keen
  • 3,001
  • 4
  • 34
  • 59

1 Answers1

31

Rate limits are segmented by the type of authentication, user or app. User authentication is any OAuth process that is based on the user. Application-only authentication is for your application credentials and not based on user. In the case of Search, you have a 15 minute window of 180 for user and 450 for app. For a higher rate limit (in the case of search) use application-only authentication. This will give you:

24 hours x 4 15-minute increments x 450 requests per 15-minute increments == 43200 requests per day

You just have to control your app so that it doesn't exceed 450 requests in a 15 minute interval.

Here's Twitter's docs on rate limiting:

https://developer.twitter.com/en/docs/basics/rate-limiting

You can also use the X-Rate-Limit-Limit/Remaining/Reset HTTP headers and the rate-limiting endpoint to keep track of where you're at and what's available:

https://developer.twitter.com/en/docs/developer-utilities/rate-limit-status/api-reference/get-application-rate_limit_status

Joe Mayo
  • 7,501
  • 7
  • 41
  • 60
  • 1
    If I get 100 tweets in one request, will it be considered as 1 request or 7 request ? – keen Jan 24 '14 at 05:03
  • 1
    That's 1 request. It also means you want to set it to 100, rather than the default of 15, to maximize the number of results you get per query. – Joe Mayo Jan 24 '14 at 05:12
  • I read it somewhere that this would considered as 7 request.But i couldn't find that document again. Sorry for asking it again. but are your sure that this would only be 1 request? do u know any document which says this? – keen Jan 24 '14 at 06:25
  • 3
    @BSThakrar I gave you the links to the Twitter API docs and explained how rate limiting works. Now you need to write code and try it. Then you will know for sure. – Joe Mayo Jan 24 '14 at 16:55
  • and if i page through the cursor returned, to get the records beyond 100? is that second call considered a whole new request against my rate limit? – Randy L Jun 26 '15 at 15:01
  • 2
    @the0ther Yes - so, you'll want to maximize the count of items per request (depends on endpoint) to minimize the number of requests. – Joe Mayo Jun 26 '15 at 15:50