I have only now gotten my R script to function in order to search in twitters full archive, and I have used the following code to get my bearer token! Right now, as it seems to be almost working, I have, however, gotten the error that I am out of monthly requests! Without even having utilized my code, only tested it quite a few times without result. Does anyone know how to cope with this? It is for a exam, and I need to access twitter data from 2015. Please help.

Kind regards, Sara

sf <- search_fullarchive(
  q="exam",
  n=100,
  fromDate = 201501010000,
  toDate = 201506190000,
  env_name = "exam",
  token = token
)

Unfortunately 1 call in R may “cost” several in the API - each successful call is counted, even if it’s the same one multiple times, or if it’s returning multiple pages - in that case, 1 call returns 100 tweets in sandbox level or 500 tweets in paid levels, or 30 days worth of tweets, whichever is first.

Your query spans just over 6 months so at a minimum it’s 7 requests. Given a query like “exam” that’s likely to match many tweets, it’s very easy to use up all your fullarchive calls (50 in sandbox). I know it’s too late for it, but using the 30day endpoint has more calls test code with.

Also, if you’re using rtweet, currently it hardcodes page sizes of 100 which is not optimal https://github.com/ropensci/rtweet/issues/347 maybe an alternative implementation from that issue or https://github.com/FilipeamTeixeira/TweetAPI-premium/blob/master/TweetAPI_premium.R will be better if you’re using a paid plan.

The reset time is the “Renewal date” on https://developer.twitter.com/en/account/subscriptions - that’s when the calls will be reset to 0 again.

Also another gotcha to note: if you pay for a premium package for fullarchive now, your quota will not reset to 0 either - if you pay for the 100 request $99 one it will be 50 requests, not 100 - because you already used 50, and when it resets it will be 100 again.

1 Like

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