Madcoda\Youtube\Youtube::searchVideos PHP Method

searchVideos() public method

Search only videos
public searchVideos ( string $q, integer $maxResults = 10, string $order = null ) : StdClass
$q string Query
$maxResults integer number of results to return
$order string Order by
return StdClass API results
    public function searchVideos($q, $maxResults = 10, $order = null)
    {
        $params = array('q' => $q, 'type' => 'video', 'part' => 'id, snippet', 'maxResults' => $maxResults);
        if (!empty($order)) {
            $params['order'] = $order;
        }
        return $this->searchAdvanced($params);
    }