Filtering in the search API



Breaking this off from Verified filter in user search API as it has nothing to do with filtering for Verified users…


Firstly, I think the syntax here should be AND rather than & to combine search expressions (similarly, you can use NOT and OR in search expressions).

You can’t use the filter: option to search on location. That’s for filtering on things like links, or other content like photos.

For location, on the web you can use near: and within: but they require a specific place, and they are not available in the API - for that, you can use the geocode feature in the Search API. Note that only a limited number of Tweets may have geo data attached, if the user specifically chooses to mark a location in their Tweet.

You can also use lang: to find Tweets in specific languages.


Thanks for your response Andy.

I’m looking to search users and not tweets. Let’s say something that does already.

Search users with certain keywords in their Bio and filter based on location, programmatically.

I’m trying to work on a POC for a concept I’ve come up with and trying to figure using the “users/search” api instead of “public/search”.

Appreciate any inputs.



I don’t believe that users/search supports any special operators for filtering, I’m afraid.