0

I am trying to retrieve a selection of tweets with a given keyword using the Twitter API in R using the following code:

library(dplyr)
library(twitteR)
library(rtweet)

API_key = "XXXXXXX"
API_secret = "XXXXXXXX"
Access_token = "XXXXXXXXX"
Access_secret = "XXXXXXXXXX"
setup_twitter_oauth(API_key,API_secret,Access_token,Access_secret)

# Search for tweets
searchTwitter("keyword")

But this produces the following result:

Error in twInterfaceObj$doAPICall(cmd, params, "GET", ...) : 
  Forbidden (HTTP 403).

I have the free version of Twitter Developer, so I don't know if I'm receiving this error because this functionality is only available with a paid subscription? Whether that is the issue or it's a problem with the code, if someone could help me to understand what I need to do to make it work then I would be very grateful.

I tried the code as stated in the question, and tried a few alternatives found online but with no success.

James
  • 13
  • 2

0 Answers0