Rtweet tweet_search_recent() function

Hello, I have used the tweet_search_recent() function but only gives a list of 3 variables. How can I get the 90 variables that the search_tweets() function used to give.

1 Like

I assume that you are using the latest rtweet version 2.0.0. But without knowing which code did you execute is very hard to guess how to help you.
Also note that the old search_tweets was using API v1.1 while the new tweet_search_recent uses the API v2, which return different type of data.

Last, please note that this package is no longer maintainer (I was the maintainer but I do no longer will be doing it).
I am open to consulting and compensation for supporting users.

Hello, yes, I have been using rtweet version 2.0.0., nevertheless a couple years ago I used rtweet version 0.7.0 and using the following code:

api_key <- ""
api_secret_key <-""
access_token <-"
access_token_secret <-""

twitter_token<-create_token(app = "",
consumer_key=api_key,
consumer_secret=api_secret_key,
access_token=access_token,
access_secret=access_token_secret )

tweets <- search_tweets("query",
n = 20,
include_rts = FALSE,
token = twitter_token)

and the variables I used to get were the following:

[1] "user_id" "status_id" "created_at" "screen_name" "text"
[6] "source" "display_text_width" "reply_to_status_id" "reply_to_user_id" "reply_to_screen_name"
[11] "is_quote" "is_retweet" "favorite_count" "retweet_count" "quote_count"
[16] "reply_count" "hashtags" "symbols" "urls_url" "urls_t.co"
[21] "urls_expanded_url" "media_url" "media_t.co" "media_expanded_url" "media_type"
[26] "ext_media_url" "ext_media_t.co" "ext_media_expanded_url" "ext_media_type" "mentions_user_id"
[31] "mentions_screen_name" "lang" "quoted_status_id" "quoted_text" "quoted_created_at"
[36] "quoted_source" "quoted_favorite_count" "quoted_retweet_count" "quoted_user_id" "quoted_screen_name"
[41] "quoted_name" "quoted_followers_count" "quoted_friends_count" "quoted_statuses_count" "quoted_location"
[46] "quoted_description" "quoted_verified" "retweet_status_id" "retweet_text" "retweet_created_at"
[51] "retweet_source" "retweet_favorite_count" "retweet_retweet_count" "retweet_user_id" "retweet_screen_name"
[56] "retweet_name" "retweet_followers_count" "retweet_friends_count" "retweet_statuses_count" "retweet_location"
[61] "retweet_description" "retweet_verified" "place_url" "place_name" "place_full_name"
[66] "place_type" "country" "country_code" "geo_coords" "coords_coords"
[71] "bbox_coords" "status_url" "name" "location" "description"
[76] "url" "protected" "followers_count" "friends_count" "listed_count"
[81] "statuses_count" "favourites_count" "account_created_at" "verified" "profile_url"
[86] "profile_expanded_url" "account_lang" "profile_banner_url" "profile_background_url" "profile_image_url"

Now i use rtweet version 2.0.0 with the following code:

client <- rtweet_client(app = "")
client_as(client)

auth <- rtweet_app()

auth_as(auth)

tweets <- tweet_search_recent("query", n = 5000)

and I only get this variables now:

"edit_history_tweet_ids" "id" "text"

I have the basic $100 subscription. I tried to use the older rtweet 0.7.0 version and the older code but I got the following message:

Warning: You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/portal/product - 453
Warning message:
You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here: https://developer.twitter.com/en/portal/product

1 Like