How to Exclude retweets and replies in a search api?
Old post, but people might still stumble upon it.
Most query operators are documented here: https://dev.twitter.com/rest/public/search
But for the search/tweets method, you can also specify exclude:replies
and/or exclude:retweets
to filter out replies and retweets from the result.
Just test it in the API Console Tool and see for yourself.
Bonus: Another undocumented query operator is filter:verified
to get tweets from verified users.
Example query: cats filter:vine filter:verified exclude:replies exclude:retweets
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