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 retweets.
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
There is no direct way to exclude retweets and replies from the api. However, you can filter out the results you have got.
For replies, you can check if the in_reply_to_status_id
field you get from api is null, that means its not a reply else if it contains a id, then its a reply.
For retweet, if you want posts that have not been retweeted ever, you can check for retweet_count
= 0 or if you want posts that have not been retweeted by your authenticated user, you can check for retweeted
= false