control_rate_limit: Control requests in line with the rate limit

Description Usage Arguments

View source: R/Functions.R


This utility function helps to write loops to download Twitter data while respecting rate limits. If you specify a query type, it will pause and wait until the next 15-minute window before continuing. So it can be inserted in loops before a call to, say, get_friends, and will ensure you aren't rate limited. The limit parameter optionally lets you set the threshold for pausing to a level above zero, for specific use cases. The token parameter allows you to set a limit for a specific token rather than a set, which is occasionally useful.


control_rate_limit(query = NULL, limit = NULL, token = get_tokens())



Required. Used to specify a query such as 'application/ratestatus'.


Allows you to set the limit at which the function will pause. Defaults to zero.


This allows you to specify which token to check on, if you only want to check on one. Default is to check all

seanchrismurphy/twtools documentation built on May 29, 2019, 4:27 p.m.