Search code examples
twitterrequesttwitter-follow

Twitter stream API request - don't follow certain users


I don't want to receives tweets from certain users. Twitter documentation mentions about "follow" param, but I need inversion of this option. Is there any other option than filtering it on the side of my app?


Solution

  • The standard Twitter streaming API filter options do not allow you to exclude results from the filter pattern - it is inclusive. The enterprise PowerTrack API does have the ability to exclude terms and users as part of the filter pattern, but it is commercial.

    You will have to filter the results in your own code. You could do this by looking for the presence of the user object belonging to the user you want to exclude, and ignoring those Tweets.