Looks up users.
Usage
user_search(
ids,
expansions = NULL,
fields = NULL,
...,
token = NULL,
parse = TRUE,
verbose = FALSE
)
Arguments
- ids
A user id string or up to 100.
- expansions
Set
NULL
to not use any expansion, setNA
to get all expansions, or provide a vector with the expansions you want (create it withset_expansions()
).- fields
Set
NULL
to not use any field, get all allowed fields withNA
, provide a list with the fields you want (create it withset_fields()
).- ...
Other arguments passed to the API.
- token
These endpoints only accept a bearer token (can be created via
rtweet_app()
). In most cases you are better of changing the default for all calls viaauth_as()
.- parse
If
TRUE
, the default, returns a tidy data frame. UseFALSE
to return the "raw" list corresponding to the JSON returned from the Twitter API.- verbose
A logical value to provide more information about paginated queries.
Value
A data.frame with the id, name and username of the accounts.
Other information depends on the expansions
and fields
requested.
Accepted values are:
Expansions:
set_expansions(tweet = NULL, list = NULL)
.Fields:
set_fields(media = NULL, poll = NULL, place = NULL)
.
References
https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-id https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users
Examples
if (FALSE) {
us <- user_search(c("1599030512919650304", "2244994945"), verbose = TRUE)
}