Learn R Programming

rtweet (version 2.0.0)

user_by_username: Search users by username

Description

Looks up users by their username.

Usage

user_by_username(
  username,
  expansions = NULL,
  fields = NULL,
  ...,
  token = NULL,
  parse = TRUE,
  verbose = FALSE
)

Arguments

username

A user name string or up to 100.

expansions

Set NULL to not use any expansion, set NA to get all expansions, or provide a vector with the expansions you want (create it with set_expansions()).

fields

Set NULL to not use any field, get all allowed fields with NA, provide a list with the fields you want (create it with set_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 via auth_as().

parse

If TRUE, the default, returns a tidy data frame. Use FALSE 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.

References

https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by-username-username https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by

See Also

user_search()

Examples

Run this code
if (FALSE) {
  user_by_username("rOpenSci")
  user_by_username(c("Bioconductor", "R_Contributors"))
}

Run the code above in your browser using DataLab