Need hep on downloading tweets from "GET search/tweets" endpoint


#1

Hi ,

I am trying to search and download as many tweets as I can (the limit being 3200) that contain a specific word or phrase.
I have red the documentation provided by Twitter.
https://dev.twitter.com/rest/reference/get/search/tweets
https://dev.twitter.com/rest/public/timelines

and I think I understood the point but I am having trouble downloading the data.
The first call I make looks like this
//api.twitter.com/1.1/search/tweets.json?q=%40twitterapi&count=1
this gives me the json response which contains the field “next_results”:"?max_id=533772079888XXXX&q=…
then I use the max_id provided here to make my second call, but this time I step up the count to 100.
//api.twitter.com/1.1/search/tweets.json?max_id=533772079888XXXX&q=%40twitterapi&count=100
this gives me a json responce containing 65 tweets. But this time I don’t have the “next_results” field.
and I am not able to make the subsequent calls to get the rest of the tweets.
And no matter what I try, I either end up with the same result or no result at all.

I tried manually entering the max_id = the last id from the previous response & count =100.
I tried setting since_id = the last id from previous response - 100 & count =100.
I have tried combining the two variables.

note: the above mentioned approaches seems to work fine when I try them on a subset of the 65 tweets but I can’t seem to go beyond that last tweet. By beyond I mean back in time. 1 being the most recent tweet and 65 being the oldest tweet I am able to access currently. Which is from Saturday November 8th, exactly 1 week from now.


#2

The search API will not allow you to go back beyond about a week, so this sounds like it is working as designed.