API always return same amount of results



Hello. I have the following code:




final class Initialization {

	 private $settings = [];

/** Set access tokens here - see: https://dev.twitter.com/apps/ **/
	function __construct() {
		$this->settings = [
    	'oauth_access_token' => "",
    	'oauth_access_token_secret' => "",
    	'consumer_key' => "",
    	'consumer_secret' => ""
	// Getter for variable $settings
	public function getSettings() {
		// PHP requires $this->settings in order to read member variable $settings
		return $this->settings;




final class ImplementationSearch {
	 function __construct() {

		$initialization1 = new Initialization();
		$url = 'https://api.twitter.com/1.1/users/search.json';
		$getfield = '?q=employed%20Microsoft';
		$requestMethod = 'GET';
		$twitter = new TwitterAPIExchange($initialization1->getSettings());
		// String result of API 
		$results = $twitter->setGetfield($getfield)
             ->buildOauth($url, $requestMethod)
        // Decode String to JSON Object - 'true' is required in order to make it to String array and not STD class     
        $resultsToJson = json_decode($results,true);  
        for($i = 0; $i < count($resultsToJson); $i++){
				echo $resultsToJson[$i]['description'];
				echo "<br/>";



$implementation1 = new ImplementationSearch();

So either if i search for $getfield = '?q=employed%20Microsoft'; or for $getfield = '?q=Microsoft'; the results are always 20. Any ideas why?


From GET users/search

count - The number of potential user results to retrieve per page. This value has a maximum of 20.

If you want to get more results you will have to implement pagination using the page parameter value.


Hello. Thank you for your answer. Since this the first time i attempt something like that, this is what you mean?

    $getfield = '?q=Working%20at%20Microsoft&page=' . ++$pageCounter;

in a while loop so i get one page for each request every time?


In essence something like that should work.


The only problem is that i am only able (with each app) at least to retrieve only 180 pages each 15 min? Is that correct?


That’s the API rate limit, correct.