Hello, I am registering the following error when using the twitter API in R “Error: Twitter API failed [403]. Check the error message in Twitter API Response Codes & Error Support | Twitter Developer Platform. * You currently have essential access that includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you must request elevated access through the Developer Portal. More information can be found here: Getting Started with the Twitter API | Docs | Twitter Developer Platform (453)”. While researching this error I find that it may be due to the account including the final access point however I recently requested my certification as an academic researcher. My credentials are:

appname ← “xxxxxx”
consumer_key ← “xxxxxxxxxxxxxxxxxxxSHLg”
consumer_secret ← “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxPJ3U”
access_token ← “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxm3w”
access_secret ← “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxHzdQ”

im using rtweet from R

twitter_token ← create_token(
app = appname,
consumer_key = consumer_key,
consumer_secret = consumer_secret,
access_token = access_token,
access_secret = access_secret).

The R library you are using is making calls to v1.1 API, when you don’t have access to it.

The best thing to do is to try and use a package like GitHub - MaelKubli/RTwitterV2: R functions for Twitter's v2 API or if you have academic access, GitHub - cjbarrie/academictwitteR: Repo for academictwitteR package to query the Twitter Academic Research Product Track v2 API endpoint.

Hi how are you? Thanks for your answer.

I have tried what you suggested, but I get the same error code when I try to download the tweets with academictwitteR. I currently have my researcher account authorized, so I was able to mine the bearer token.

i followed these steps

Set the bearer token

set_bearer()

I restarted R

Search tweets containing the word “hello”

tweets ←
get_all_tweets(
query = “#BlackLivesMatter”,
start_tweets = “2023-01-20T00:00:00Z”,
end_tweets = “2023-01-25T00:00:00Z”,
file=“blmtweets”
)

Which gives me the following error

Error in make_query(url = endpoint_url, params = params, bearer_token = bearer_token, :
something went wrong. Status code: 403
In addition: Warning message:
Recommended to specify a data path in order to mitigate data loss when ingesting large amounts of data.

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