Dear Team,

I want to ‘Stream Tweets in real-time’. And I am using https://github.com/twitterdev/Twitter-API-v2-sample-code/blob/master/Filtered-Stream/filtered_stream.py code. However, I could not find any field/parameter to mention the limit/count of the tweets I want to collect.

I am aware of the overall limit on a standard account and academic account. But I want to do proactive coding by mentioning the number of real-time tweets I want to collect.

Any help will be appreciated.

The stream will continue as long as there are results, you would have to limit it manually yourself.

I recommend using twarc for this (limits are already implemented): GitHub - DocNow/twarc: A command line tool (and Python library) for archiving Twitter JSON

Thank you, @IgorBrigadir, for the information. I will try that.