How to Exclude retweets and replies in a search api?

rakesh r picture rakesh r · Jan 14, 2015 · Viewed 28.9k times · Source

How to Exclude retweets and replies in a search api?

I am trying to fetch the feeds from twitter using search api, in the result I am getting replies and retweets also.

So I want to exclude replies and excludes.

How to do it anybody help me.

This is my url:

https://api.twitter.com/1.1/search/tweets.json?q=from:rioferdy5&count=20&result_type=recent

Answer

Paul Thomas picture Paul Thomas · Mar 18, 2015

I beleive the above is incorrect, you can use filters in the search API but the documentation is very poor (non-existent?).

Your query would become:

?q=from:rioferdy AND -filter:retweets AND -filter:replies&count=20&result_type=recent

More tips for filtering were obtained here: How to Master Twitter Search: Basic Boolean Operators and Filters