Hi, I have been approved for Academic Research Account but as I was trying to authenticate my account and run come lines of codes in R Studio, it keeps telling me that my account is still Essential access. Does anyone know how to resolve this? See error below for more context:
appname ← “my app name”
consumer_key<- “my consumer key”
consumer_secret<- "consumer secret "
access_token<- “my access token”
access_secret<- “access secret”
twitter_token ← create_token(
app = appname,
consumer_key = consumer_key,
consumer_secret = consumer_secret,
access_token = access_token,
access_secret = access_secret)
twitter_token
setup_twitter_oauth(consumer_key, consumer_secret, access_token, access_secret)
post a tweet from R
post_tweet(“Look, i’m tweeting from R! #Learningsomethingnew”)
your tweet has been posted!
output:
$errors
$errors[[1]]
$errors[[1]]$message
[1] “You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal. You can learn more here: Getting Started with the Twitter API | Docs | Twitter Developer Platform”
First make sure that the keys belong to an app added to the academic research project that was created for you. If the library youre using is Rtweet, it won’t work, that only supports v1.1 API, and academic access is v2 API only, so you need to use GitHub - cjbarrie/academictwitteR: Repo for academictwitteR package to query the Twitter Academic Research Product Track v2 API endpoint. (it does not support posting tweets either, but you could make calls manually with httr or something.)
2 Likes
Thank you so much for your reply @IgorBrigadir. I indeed was using the wrong app ( i had two apps, one was only essential and turns out i was using that one for this purpose and so it wasn’t working).
Do you know how to get access to posting tweet features? My understanding is that academic research is the highest level of privilege we get for twitter api but even this is not eligible to make posts?
1 Like
Academic Access gives you extra filtering ability for streaming in tweets and search using the v2 full archive endpoint, and that’s it I think. And you always use a bearer token for authentication. I think the summary for access levels is here Getting Started with the Twitter API | Docs | Twitter Developer Platform
Posting with v2 is also possible POST /2/tweets | Docs | Twitter Developer Platform but I don’t know if an R library exists that supports that as a function right now ( I could be wrong though, maybe there is a library already out there, and I’m actually not that good with R anyway), so your best bet is to make the call yourself using httr - you can’t use a bearer token here, it has to be the API keys and Access token
Hope that helps!
You’ve been very helpful, thank you @IgorBrigadir. If i find anything more that’s relevant to this topic, I’ll post it below.
1 Like