Exclude username when searching


Hello, when searching using the search API 1.1 the query is matched against usernames as well as status updates. Is there a way to restrict to status updates only?


No, there is not. However, you can omit results authored by specific users with operators like:

-from:username -from:username2


Not exactly what I was looking for as I don’t know the username in advance, but thanks anyway


I am also facing the same problem and this is happening on my production server. This is a huge change on Twitter’s part to include username in searching. Its a huge blunder, for example
Search Query = "nokia"
For this query it is fetching data matching the usernames also. Tweets from user “nokia_mania” is also being fetched irrespective of that tweet contain “nokia” as the keyword or not.

Please provide us the solution of this asap. Thanks in advance.


Search is constantly evolving. It’s not a steady state interpreter of queries. Post-filter what’s not useful for you or consider using a Streaming API instead.


Thanks for your reply sir.
I am using Streaming also on another server. Is it that inclusion of “username” in search like REST API v1.1 is not included in Streaming API ? Please confirm if scenario i mentioned above wont exist in Streaming API, if it is so then will then discard REST API because i am facing huge problem of username match in search :frowning:

Is there any way out except restricting few username like you mentioned
(-from:username1) because while searching we cant predict which username can match the query?


Any update on this topic? There need to be a way to exclude usernames when searching.


You can either use the “-from:username” syntax, or you can post-filter the results of the search yourself.


I’m frequently searching tweets about some anime titles and got too many non relevants tweets from users whose name contains ANIME ttile they are watching current season or favors. Is there any options to exclude name and username as a target for searching?


There’s no option in the API to enable you to do that - you’d need to manually filter them out from the result set.


Thank you for reply. Many Japanese users felt this feature is very annoying and complain. Please conside add excluding option.


I’m mainting search options to include many “-from:username” terms. But adding many options on tweetdeck, search fails (returns wrong results/too old tweets only returns). Is there any alternative options?