Premium API results still not further than 9 days back

Hello,
I requested (and paid) a Full Archive / Premium API and set up the Developers environment (only of the Premium environment, not the Sandbox). My results after searching Tweets, are still limited till 9 days, while not reaching my maximim requested n of 500. I changed the keys and tokens a few times, but makes no difference. Can anyone explain to me what’s happened?
Thanks in advance

Hi,
Thanks for reaching out here. How are you calling this endpoint? You might want to consider using the search-tweets wrapper for Python or Ruby.
Hope this helps!

Jessica

Hi,
Thanks for your respons. I’m using R, with package twitterR and rtweet. My Twitter API dashboard also shows no activity…but I still get results.

sounds like R is still calling the Standard Search API. twitteR package is not maintained, and does not support Premium calls - i wouldn’t use that one.
in rtweet, these should work: https://rtweet.info/reference/search_30day.html or https://rtweet.info/reference/search_fullarchive.html - these have recently been added so i’d make sure that rtweet is up to date in R packages with install.packages(“rtweet”)

Thanks a lot Igor. This helps me a little bit further, but still no results and an error:
tweets/search/fullarchive/MarungaDevAPI ***Warning: list(message = “Forbidden: Authentication succeeded but account is not authorized to access this resource.”, sent = “2019-08-27T06:47:14+00:00”, transactionId = “001534d30083fa97”)
I updated the rtweet package and used this line of code:
df <- search_fullarchive(‘xxxxx’, n = 500, fromDate = 201707010000,

toDate = 201908260000, parse = TRUE, env_name = ‘MarungaDevAPI’)
Understanding the error it has something to do with the authorizations, but I have the Premium package with 100 requests / month.
Do you know maybe what to do?

Thanks in advance!

Marjan

In https://developer.twitter.com/en/account/environments is the app name beside “Search Tweets: Full Archive” the same one that you are setting up in rtweet? Also, the environment name has to match and if you have paid for Premium it should not say “Sandbox” - you may need to create a new environment.

Yes, did all that…

Environment name in rtweet is the same as the one mentioned in my environments in my Account next to ‘Search Tweets: Full Archive’. Didn’t use the Sandbox-one. I deleted everything again, made a new environment, created new keys and tokens, but still get the same error :-(.

I wonder if it’s the way rtweet is authenticating? I don’t have R installed to check at the moment.
This error always comes up whenever the environment name does not match what’s on https://developer.twitter.com/en/account/environments. Maybe rtweet is lowercasing it or something? I think it’s case sensitive but i’m not sure.
One way to check that is with using https://github.com/twitter/twurl (and making sure twurl is authorized with the correct app)
Here’s a minimal call that should work: MarungaDevAPI is your environment name.

twurl "/1.1/tweets/search/fullarchive/MarungaDevAPI.json" -A "Content-Type: application/json" -d '{"query":"nasa lang:en", "maxResults":"100"}' > test_nasa_tweets.json

Thanks a lot for all your help Igor. When checking my token with identical(token, get_token()), it keeps giving [FALSE]. But after deleting the line starting with TWITTER_PAT= in file.edit("~/.Renviron"), restarting R and not creating a token first, I get my wanted results. Also can find back in my Full Archive: Premium on https://developer.twitter.com/en/account/subscriptions that I used a query now.
Thanks!

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