How to exclude retweets and responses in api search

How to exclude retweets and responses in api search

I try to extract feeds from twitter using api search, as a result I get answers and retweets, so I want to exclude answers and exclude.

how to do it help me

this is my url

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

+4
source share
6 answers

There is no direct way to exclude rehearsals and responses from the api. However, you can filter the results.

For the answers you can check if the field in_reply_to_status_idthat you get from api is null, this means that it is not an else answer if it contains an identifier and then its answer.

, , , , retweet_count= 0 , , , retweeted= false

+2

, , API , (?).

:

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

: :

+28

, .

: https://dev.twitter.com/rest/public/search

search/tweets exclude:replies / exclude:retweets, .

API- .

: filter:verified .

: cats filter:vine filter:verified exclude:replies exclude:retweets

+8

exclude_replies=true

+1

, . Hitesh , , , , retweet json. , , retweeted_status typeof '( , - ) , ' undefined '( , ). retweet_count=0 , - @pattonoswalt . , , .

- :

if(typeof tweets[i].retweeted_status === 'object') {tweets.splice(i,1);}

if(typeof tweets[i].retweeted_status !== 'undefined') {tweets.splice(i,1);}

+1

yes, you can exclude retweets during the API search by adding -RT(q) to the search bar. Example:search?q="#demo -RT"

-1
source

All Articles