rate_limit: Rate limit helpers

View source: R/rate_limit.R

rate_limitR Documentation

Rate limit helpers

Description

  • rate_limit() returns a tibble of info about all rate limits

  • rate_limit_reset() returns the next reset for a endpoint

  • rate_limit_wait() waits for the next reset for an endpoint

You should not need to use these function in the usual operation of rtweet because all paginated functions will wait on your behalf if you set retryonratelimit = TRUE.

Usage

rate_limit(resource_match = NULL, token = NULL)

rate_limit_reset(endpoint, token = NULL)

rate_limit_wait(endpoint, token = NULL)

Arguments

resource_match

An optional regular expression used to filter the resources listed in returned rate limit data.

token

Use this to override authentication for a single API call. In many cases you are better off changing the default for all calls. See auth_as() for details.

endpoint

Name of Twitter endpoint like "lookup/users", "/media/upload", or "/feedback/show/:id".

References

https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/rate-limit-status

See Also

Other tokens: create_token(), get_token()

Examples

if (auth_has_default()) {
rate_limit()
}

rtweet documentation built on Oct. 17, 2023, 1:11 a.m.