Twitter search API returns much fewer results than the Twitter client search engine. Why?


I am using the Twitter Search API with the PHP library TwitterOAuth 0.5.1 to process tweets containing a given hashtag (#citylightsorchestra for instance).

My request (see the source code below) returns only 1 result when the Web client search engine returns something like 10 tweets. Is there any way to modify my request in order to increase the result count?

require "twitter.config.php";
require "twitteroauth-0.5.1/autoload.php";
use Abraham\TwitterOAuth\TwitterOAuth;

$connection = new TwitterOAuth($consumer_key, $consumer_secret, $access_token, $access_token_secret);

$content = $connection->get("search/tweets",
                      "q" => urlencode("#citylightsorchestra"),
                      "lang" => "fr",
                      "count" => "100",
                      "include_entities" => "true",
                      "result_type" => "recent"));


Thank you for your precious help.


You are completely right and not doing anything wrong. It is not possible to get tweet older than about 1 week using the search API. In contrast the Web Search indexes nearly all Tweets since Twitter exists, that’s why you get a lot more results there.
Last info we got from Twitter about is, that currently there are no plans to make this available (for free) to the public REST API.


@ePirat is correct.

If you are tracking specific keywords or hashtags we suggest using the real-time statuses/filter steam, storing the data, and running searches against your own datastore. Keep in mind that the public streams will only return up to 1% of all Tweets. Most use cases will fall within that limit.

If you are looking for enterprise grade data APIs for Tweets, you should looks at Gnip, which is a Twitter company. Through Gnip, we provide the Historical Powertrack search API allowing access to Tweets back to 2006. This is a paid product which provides an elevated level of support and consultation from our engineers.