get_user_id | R Documentation |
This function get the user IDs (e.g. 1349149096909668363) of given usernames, e.g. "potus".
get_user_id(
usernames,
bearer_token = get_bearer(),
all = FALSE,
keep_na = TRUE
)
usernames |
character vector containing screen names to be queried |
bearer_token |
string, bearer token |
all |
logical, default FALSE to get a character vector of user IDs. Set it to TRUE to get a data frame, see below |
keep_na |
logical, default TRUE to keep usernames that cannot be queried. Set it to TRUE to exclude those usernames. Only useful when all is FALSE |
a string vector with the id of each of the users unless all = TRUE. If all = TRUE, a data.frame with ids, names (showed on the screen) and usernames is returned.
## Not run:
bearer_token <- "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
users <- c("Twitter", "TwitterDev")
get_user_id(users, bearer_token)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.