Available filters from search api


I don’t see any documentation on filters available from the search api. We have clauses for include_entities and include_retweets. Are there others? It looks like include_replies and exclude_replies might be available because i do get tweets back from that. Is this stuff documented anywhere?


The documented advanced features of the Search API can be found here: [node:203]


Yes, but it’s not complete. I don’t see any reference to “include_retweets”. What i’m looking for is a complete list of all the includes and excludes. I see nothing about replies.


Is there another way I can get answers to these questions? I’ve been trying for the last couple of weeks to get an answer to what I would have thought a simple question. All I want is a list of all the filters for the search api. There are no docs that show this list as far as i can tell. I’d be happy with a partial list.


“Filters” for the search API are presented on the query string. include_retweets and include_entities are parameters and not really filters in our typical meaning of the words. (Example, “from:user” is a filter that you use within a query on the Search API.

If you don’t see a filter or parameter documented on this site, then it’s not officially part of the API and you should avoid using it.


With that said, I see where include_entities is documented. I don’t see where include_retweets is documented. If you look on page:


there is no “include_retweets”. There is loose reference of it on other pages and I can see from the advanced search that it is generated.

So, is there perhaps a less official list of parameters that we might consider using?


The include_retweets parameter is a mostly historical artifact in API v1.1. It was originally introduced in various methods of API v1, including the classic search.twitter.com API, as retweets weren’t originally part of the API and you had to “opt-in” to receive their special structure.

In API v1.1 retweets are included by default. Not all methods support the ability to disinclude them with include_retweets=false.

The Search API actually is an API that doesn’t support this parameter, which is why it’s not part of its documentation. Retweets (tweets with retweeted_status objects embedded inside them) will be returned for queries regardless of you specifying the parameter. If you don’t want to include retweets in your search results, you’ll need to post-filter them from the results you receive.


Excellent. OK, I’ll take responsibility of the “filtering” then. There are benefits to it being done on the server side because if I ask for the most recent 5 tweets, all 5 will be usable and not get filtered out post retrieve. But an api is an api.