title: Youtube V3 API - Fetch a random video based on keyword
body: <p>I am using the below code to navigate to different pages of Youtube data.</p>
  
  <p>I call the service again and again based on $randomNumber ( 1 to 20). But I don't think this is the better way.</p>
  
  <pre><code> $youtube = new Google_Service_YouTube($client);
  
      $searchResponse = $youtube-&gt;search-&gt;listSearch('id,snippet', array(
          'type' =&gt; 'video',
          'q' =&gt; $searchTerm,
          'maxResults' =&gt; $videoCount
      ));
  
      $nextPage = $searchResponse["nextPageToken"];
  
      for($i=1;$i&lt; $randomNumber ;$i++){
  
          $newSearchResponse = $youtube-&gt;search-&gt;listSearch('id,snippet', array(
              'q' =&gt; $searchTerm,
              'maxResults' =&gt; $videoCount,
              'type' =&gt; "video",
              'pageToken' =&gt; $nextPage
          ));
  
          $nextPage = $newSearchResponse["nextPageToken"];
  
      }
  
     return $newSearchResponse;
  </code></pre>
  
  <p>Please let me know how to get a random video based on the search text.</p>