Rtweet : Streaming tweets

How does the packages Rtweet stream tweets?

Much thanks!

Using Twitter's API, check the source code for more details.
If you need a detailed answer, please provide more context and make specific questions.
Many thanks for using the package

According to literature found online, rtweet makes use of its own app "rstats2twitter". Therefore, is it fair to state that streaming is done via the "rstats2twitter"which interacts with the twitter streaming APIs?

No, Twitter uses the confusing (to me) wording that all the authentications that are not users are apps.
The "app rstats2twtiter" is just the default authentication the package uses when interacting with twitter streaming API.

If you are using the package for more than one day I strongly recommend you to set up your own authentication.

I am currently developing a project that requires real time live streaming of tweets. Therefore, with reference to your last reply should I use my own app? If yes, are there any sort of rate limits I should take note off?

Yes, you should create your own authentication. If you don't you'll share the usage of the app with all the other users of rtweet without authentication and you might hit the rate limits earlier.
The rate limits are provided on the website Rate limits | Docs | Twitter Developer Platform .
You can also check them via rtweet::rate_limit().

1 Like

Noted, thanks. Should I then pass my authentication token via the token argument in the stream_tweets function?

Do tweets gathered through the stream_tweets function contribute towards the monthly cap of tweets assigned to my app?

Use whatever way of authentication it makes sense on your project. If you have only one authentication credentials you can relay on it being stored by default on the .Renviron file.

I'm not sure which is the "monthly cap of tweets" you are referring, if you refer to "500,000 Tweets per month from the recent search and filtered stream endpoints", yes this cap is applied on streamed tweets. Please, read in detail the documentation of the Twitter API.

By passing my token in the stream_tweets command, is rtweet streaming tweets via my assigned app?

rtweet will use either the default or the one authentication passed on the function call (if there are no bugs).

Much thanks! Lastly, does rtweet use the new Twitter API v2 or does it use v1.1?

You might have already found it on the issues, it uses API v1.1. Until very recently v2 wasn't operative, and I think it still doesn't cover all endpoints of v1.1.

Therefore, since "rtweet" makes use of the API v1.1, what is the monthly tweet cap usage, since in my developer portal I only have my monthly tweet cap usage associated with the API v2?

In online literature, I have found that the API 1.1 has no monthly tweet cap usage but only has rate limits.

I stand corrected, there doesn't seem to be a monthly rate limit, I didn't realize the link I provided earlier was just for API v2. Good luck with your project.

1 Like

Thank you so much for your help.

Just to be clear, therefore the API v1.1 does not have a monthly tweet cap usage unlike the API v2?

If yes, can I technically use a filtered stream (in accordance to rate limits) without worrying about the monthly cap usage?

There is no monthly limit that I'm aware of. You can use filtered stream from rtweet.
The software is provided as is, with no guarantee (read the license for more details) and I do not provide legal binding advise. I recommend to verify yourself if it works according to your needs.

1 Like

Thank you so much for both your help and time. I truly appreciate it!

Theoretically, how would I be able to test this if I can't see the monthly tweet cap usage?