imguR (version 1.0.3)

rate_limit: API rate limits

Description

Check user- and package-level rate limits

Usage

rate_limit(...)

Arguments

...
Other arguments passed to HTTP request functions, for example: token (an OAuth2.0 token) or key (an API key, used by default).

Value

“imgur_basic”.

Details

This function returns a list detailing user- and package-level API rate limits. All calls to the API deduct one unit from rate limits, except for upload_image, which deducts 10. Rate limits are lower for anonymous requests than for authenticated requests. Limits exist at the user level and at the package level. The user-level rate limit are automatically reset periodically. The response object documents when that limit will be reset.

Rate limits are automatically checked during each request. Options can be set for low remaining usage warnings. By default (when the package is loaded) those options are: options(imgur_user_rate_warning = 20) and options(imgur_client_rate_warning = 100).

Examples

Run this code
## Not run: 
# # rate limit for anonymous requests
# rate_limit()
# 
# # rate limit for authenticated requests
# tkn <- imgur_login()
# rate_limit(token = tkn)
# ## End(Not run)

Run the code above in your browser using DataCamp Workspace