REST API Date range search


#1

I am using this end “https://api.twitter.com/1.1/search/tweets.json” to search for tweets with users, keywords and hashtags.

I tried to use until and since like I was used to in API 1.0, it doesn’t return any change in the result.

Can anyone help me building a date range or any type of date control query with 1.1 ?


#2

If you go to https://twitter.com/search-home and click on “operators” you can find how to specify a time range. You add for example since:2010-12-27 or until:2010-12-27 in you query.
Note that when using the API, you can only search in the tweets of the last week.


#3

Good info. Is there a way to search more than a week?


#4

Not currently unless it’s only for one specific account and then it’s only through the timeline endpoint for a specific user and that can only go back 3200 tweets.


#5

Correct. The other method to retrieve 30-day or full archive search would be via Twitter’s commercial Gnip APIs.


#6

Thx much. That seems to be the consensus. I wish it was in the API
documentation.


#7

Good feedback. Which page(s) would you like to see this added to?


#8

Hey Andy - I went off the grid. It looks like the “7 day” search limit has been added to the right place: https://dev.twitter.com/rest/public/search


#9

OK - pretty sure it has been there for a while, glad to hear you’re seeing it there now anyway!


#10

Probably a noob oversight on my part.