data from API v2 twitter

Hello community, please, could you provide me the code to get a dataframe in rstudio of data from twitter conecting through my API v2?
This is the code that doesn't bring any data

library(rtweet)

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

create_token(
app = "xxx",
consumer_key = api_key,
consumer_secret = api_secret_key,
access_token = access_token,
access_secret = access_token_secret
)

tweets=searchTwitter("@love", n =1000)

Hi, I'm the rtweet maintainer.

Could you explain which rtweet version are you using, and where does this searchTwitter function comes from?
It would be important to know if you are using any paid tier. The free tier doesn't allow to search for tweets.

Last, reading the code you provided I realized you create a token but it doesn't tell rtweet to use it. rtweet won't magically discover it; it needs to be provided as argument in the functions or declare it as the one to be used by all functions.

Hello, thank you for your response. Tweet API that I try to use is the version free which was replaced and its name is API v2. Can I extract data in R studio from Tweeter with this API? How can you say in the code that rtweet use it? could you please correct me the code?

Please, read the conditions at the Twitter developer page about the API tiers.
rtweet can be used with the API v2.
Is Tweeter a different package or tool? I only help with rtweet.

If you are using rtweet, it needs something similar to auth_as(token) or auth_as("my_saved_token") if you don't want to use token on each call.

Yes, I can help you with your code. We can agree to some consulting hours at the right price.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.