Since: and until: search parameters not working


#1

Hi folks! I am trying to use the Search API to get tweets from a specific date range, and I believe my request is formatted correctly yet I am not receiving the correct results. Here is what my request looks like:

client.get(‘search/tweets.json?q=&geocode=’
+ req.params.geocode
+ ‘,.5km&since:’ + req.params.startdate + ‘&until:’ + req.params.enddate

Req.params.startdate and enddate are properly formatted dates (YYYY-MM-DD). If I remove those parameters from the request, the search gets no tweets. If I replace them with simply &result_type=recent, it returns the same results.

I’ve read topics from 2+ years ago that suggest Twitter only returns tweets that are around a week old, but even if I set the until parameter to be within a week it returns results past it. If anyone has any advice I would be very grateful! Thanks.


#2

This is (and always has been) true, and is described in the Search API documentation.

Can you provide specific examples of search terms and dates that are failing to return expected results?


#3

Thanks for the response Andy! I am calling: api/tweets/-22.912214,-43.230182/2015-12-15/2015-12-17 , again this is my route which is querying:

search/tweets.json?q=&geocode=-22.912214,-43.230182,.5km&since:2015-12-15&until:2015-12-17

^ Which returns, for example, a tweet that was “created_at”:“Mon Dec 21 20:36:47 +0000 2015”.

Thanks again for your help and your time, I very much appreciate it.


#4

Can you share a working query keyword so I can have a play with this?


#5

Sorry for my delayed response, I want to clarify what you mean by a working query keyword. I’m only querying with a geolocation and the time parameters, so I am not using a keyword.


#6

Per the docs, the q parameter is required. You need to specify a string to search for - at least, using twurl, I’m unable to execute a query with an empty string.


#7

https://api.twitter.com/1.1/search/tweets.json?q=%23dynamo+since:2017-01-12

This query is actually returning tweets older then 2017 year. What is wrong with my query ?


#8

The created_at value you have highlighted is the creation date of the user, not of the Tweet.