REST API rate limits - fair usage

restapi
rules
automation

#1

Hey all,

I want to ask something about the rate limits on REST API calls. (For the example I’ll talk about statuses/get_user_timeline since that’s what I’m working with at the moment). In the API reference, a call has a certain app auth limit, e.g. 1500 per 15-minute window for statuses/get_user_timeline. Given that’s 100 requests a minute (or in the case of user auth, 60 requests per minute), that seems rather high for a user manually doing things.

As such, I wanted to ask these questions:

  • Is the rate limit a “hard limit”, whereby you are allowed to make that many calls every 15 minutes? Or is it expected that this is a maximum limit for peak times, but an app is expected to generally make less calls during other periods? My assumption from previous discussions in the forums here is that it’s the latter, but I wasn’t sure.

  • If you imagine a process thread using app auth that makes (close to) 1500 calls every 15 minutes to the statuses/get_user_timeline endpoint in an automated fashion - was the REST API designed with this kind of automated usage of the endpoints at close to the rate limits all the time in mind? Or is this kind of behaviour frowned upon by Twitter?

In the Twitter Developer Policy, the following is written:

Rate Limits. You will not attempt to exceed or circumvent limitations on access, calls and use of the Twitter API (“Rate Limits”), or otherwise use the Twitter API in a manner that exceeds reasonable request volume, constitutes excessive or abusive usage, or otherwise fails to comply or is inconsistent with any part of this Agreement.

I’m looking to see whether automated usage of the GET endpoints in the manner described above would be considered to be “exceeding reasonable request volume” or “excessive usage”, even if it isn’t hitting the rate limits.

At the moment, I am in the process of designing a system to allow me to monitor the Twitter accounts of artists, and while right now I’m nowhere remotely close to nearing the rate limits, I wanted to check these points so I know how best to proceed as the number of artists I track increases.


#2

You’re not able to exceed the limit of calls within the 15 minute window, and the API does indeed support that number of calls. This is really a workaround for client apps that might want to frequently poll to refresh a timeline, or do something similar to what you’re describing. You’re right that “sensible usage” i.e. staying below the limit rather than frequently hitting it and having to back off, would be expected in normal running - you can use the x-rate-limit-remaining HTTP header to monitor your own usage. Do not create multiple app keys for the same purpose - that would constitute an attempt to circumvent the rate limit.

Bearing in mind that the standard API has no specific support or availability expectation, you’re welcome to use it in that manner, but access may be limited in times of high platform load regardless of your rate limit headers.

The automation rules generally focus on the automation of user actions (Tweets, Retweets, Likes etc) and abuse of the platform in that manner, rather than on services that are doing things with tracking or visualising data - you should ensure that your app follows those rules closely as well.


#3

Hi Andy,

That makes sense, thank you for the information :grinning:


#4