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


#1

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!


#2

Now even 1st query of -RT does not work
$getfield =
’?q=’.$tag.’%20-RT%20filter:images&result_type=recent&count=100&include_entities=true&include_retweets=false’;

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


#3

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?


#4

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


#5

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.


#6

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.


#7

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