Bug in Twitter Search API when using -RT in query with since_id


I am trying to exclude the RT tweets but something is wrong when I use the since_id for the next page

1st attempt
That brings the tweets very well

$url = ‘https://api.twitter.com/1.1/search/tweets.json’;
$requestMethod = ‘GET’;
$getfield = ‘?q=’.$tag.’%20-RT%20filter:images&result_type=recent&count=100&include_entities=true&include_retweets=false’;

2nd attempt:
But here in my ajax it repeats itself although the since_id seems to be correct, the tweet content seems to be the same with the 1st load

$url = ‘https://api.twitter.com/1.1/search/tweets.json’;
$requestMethod = ‘GET’;
$getfield = ‘?q=’.$tag.’%20-RT%20filter:images&result_type=recent&count=500&include_entities=true&include_retweets=false&since_id=’.$maxID;

I am passing the maxID correctly, I am sure about that… but I think the API has some bugs, please check out

I tested with the keyword #lrsw14
Run it and see by yourself that it is repeating!


Now even 1st query of -RT does not work
$getfield =

What is wrong with this API, why the Twitter guys don’t take this bug seriously?


I currently get 1 result for your first query, and when passing in the since_id from that single result, I get nothing back on the second query (which is what I would expect). What am I missing?


It seems that result_type=recent expires after a while and we can’t reach older tweets… anyway, let’s try the aridea

$tag = ‘aridea’;

$url = ‘https://api.twitter.com/1.1/search/tweets.json’;
$requestMethod = ‘GET’;
$getfield = ‘?q=’.$tag.’%20-RT%20filter:images&result_type=recent&count=100&include_entities=true&include_retweets=false’;

You will see the same repeating problem


Actually if you check the search/tweets documentation, the include_retweets parameter is not available (that’s a web option, not part of the API). You’ll see that the parameter is not included in the refresh_url value that is returned from the first query, either.


it doesn’t matter if you remove the include_retweets from the query itself.
I think the problem is that the query returns the latest week or mostly 2 weeks query result. So nothing left after a while when we query the same thing. I guess that is why it repeats itself after a while.

Always the same problem, the API search does not return all the tweets as Twitter Search does. They are different from each other and it pushes back the developer to use this API.


That’s correct, the search API deals with mostly a week or so of tweet data.