Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

Twitmo: Unauthorized (HTTP 401) #27

@agallell

Description

@agallell

Unfortunately it seems there are problems related to the authentication.
After running the get_tweets function I get the following error:

"Requesting token on behalf of user...
Error in twitter_init_oauth1.0(self$endpoint, self$app, permission = self$params$permission, :
Unauthorized (HTTP 401)."

In the tutorial you write "Make sure you have a regular Twitter Account before start to sample your tweets." But in the script there it is nowhere indicated how to authenticate.
Some other tutorial suggest to insert Twitter consumer key and secret using setup_twitter_oauth function, but it seems to be under a package which is no longer available.

Can you please provide guidance on how to solve the issue?
Here below the simple script I am trying to run. After that I get the error.
Thanks!

install remotes package if it's not already

if (!requireNamespace("devtools", quietly = TRUE)) {
install.packages("devtools")
}

devtools::install_version("rtweet", version = "0.7.0", repos = "http://cran.us.r-project.org")

install remotes package if it's not already

if (!requireNamespace("remotes", quietly = TRUE)) {
install.packages("remotes")
}

install dev version of Twitmo from github

remotes::install_github("abuchmueller/Twitmo")
library(Twitmo)

get_tweets(method = 'stream',
location = "GBR",
timeout = 30,
file_name = "uk_tweets.json")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions