Exact phrase searches not working in REST API v1.1


#1

According to the documentation, exact phrase searches should be possible using double-quoting (as per the Search Operators section here: https://dev.twitter.com/docs/using-search). However, I am not able to get it to work. For example, I am trying to search for the name “Al Maag”. Using the website search works just fine, eg here is a URL which shows plenty of tweets:

https://twitter.com/search?q="Al%20Maag"&mode=relevance&src=typd

But when I try to do the same search using the api, I get no results. eg I generated this test curl command using the oauth signing tool (removed oauth headers to keep it secure):

curl --get ‘https://api.twitter.com/1.1/search/tweets.json’ --data ‘count=4&max_id=250126199840518145&q=%22Al+Maag%22&result_type=mixed&since_id=24012619984051000’

How can I successfully search for an exact phrase on the api?


#2

I think the query is working for you in both contexts – the difference just is is that the Search API’s index only goes back around one week while the webstie has access to additional indexes. The last tweet matching this exact term was enough days ago that it’s no longer indexed.


#3

Ah yes, that seems to be the case. Thanks!