rielmvp
#1
I’m new to gaining Twitter Developer Elevated Access and I have been using my Twitter Developer Access to fetch Tweets using the R programming language (twitteR package). I am not sure about the date range limitation of fetching Tweets when I am using Elevated Access, since when I tried to use the searchTwitteR function as shown below for a date range beyond or within 10 days from the current date it doesn’t seem to work.
However, when I tried to use the searchTwitteR function for a date range within 9 days from the current date it then seems to work, as shown in the picture below:
Therefore I would like to ask if the date range limitation to fetch Tweets for Elevated Access is only within 9 days, and if it is the same regardless of any function I use within R, or regardless of the programming language that I choose to fetch Tweets in (same date range limitation if I use tweepy in Python?) Sorry for the seemingly naive question, but I can’t seem to find the documentation or find out where to look for the details of Elevated Access use.
Any answers much appreciated.
This library can only call v1.1 API.
The v1.1 search API is limited to the last 7 days or so (sometimes as you observe it gives you slightly more than 7) but this is the limit: Overview | Docs | Twitter Developer Platform
To get older tweets, you need either, the v1.1 Premium API, which has some free calls but is then charged per individual request, or the v2 Academic Access API which requires a totally different library and application to get approved.
I recommend updating and working with the v2 7 day recent search API instead: GitHub - MaelKubli/RTwitterV2: R functions for Twitter's v2 API
Here is a comparison table of all the available endpoints for different levels of access: https://developer.twitter.com/en/docs/twitter-api/tweets/search/migrate
rielmvp
#3
Thanks so much for the reply.
When fetching Tweets, I understand that we can also get the geocode (latitude, longitude) of Tweets as well. However, when I tried to fetch Tweets (still using twitteR package → v1.1 API), the latitude and longitude of the Tweets return NA. Might you know why this happens (example below):
Does using the v2 7 day recent search API fix this? or provides more functionalities regarding this? (filter Tweets fetched based on the location)
Best regards,
In v1.1 you have geo coordinates and also have place objects: Geo objects | Docs | Twitter Developer Platform
Very few tweets have geo coordinate location. It is very rare to find these because official clients removed the exact location features years ago. Now most tweets with location have Place objects: In v2: Place objects | Docs | Twitter Developer Platform
With elevated access, you should be able to use the geo operators that match on Places Search Tweets - How to build a query | Docs | Twitter Developer Platform
rielmvp
#5
I tried using the v2 7 day recent search API that was shared in Github. Additionally I tried to use the search query as follows and recently regenerated the bearer token:
However, I got the error code 403 which does not really explain what went down wrong. I am simply trying to get the Tweets on a specific NBA team tweeted from the same place as the team (using “place:” in the search query) and Tweets on a specific NBA team tweeted from different place from the team (using “-place:” in the search query). I have Elevated Access. Any help or information regarding this would be much appreciated.
Which one was that?
the full archive search in v2 is academic access only, so it won’t work if you have elevated access and not using the academic access project bearer token.
filter:retweets is not a valid operator for v2 API search, these are the only valid ones: Search Tweets - How to build a query | Docs | Twitter Developer Platform
This is possibly causing the error.
Try:
search_query = "@raptors -is:retweet place:\"Toronto\""