Skip to content

How to change stream track? #1339

Discussion options

You must be logged in to vote

Twitter's API does not include a way to change tracks dynamically for the same standard stream:

One filter rule on one allowed connection, disconnection required to adjust rule

https://developer.twitter.com/en/docs/tweets/filter-realtime/overview

As of right now, you'll have to use the enterprise PowerTrack API if you want to use a non-Labs endpoint to do so.

Otherwise, you'll have to create a new stream with the new track, as explained.
I'd recommend using stream.disconnect rather than manually modifying stream.running though.
See also the Missing data from disconnections section of the documentation for consuming streaming data.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Harmon758
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question This is a question API This is regarding Twitter's API Discussion This was converted/moved from/to a discussion
3 participants
Converted from issue

This discussion was converted from issue #1339 on December 15, 2020 19:54.