alaouy / YouTube

🔥 Laravel PHP Facade/Wrapper for the Youtube Data API
MIT License
782 stars 204 forks source link

Get Popular Videos By Category #113

Closed arjayads closed 5 years ago

arjayads commented 6 years ago
public function getPopularVideos($regionCode, $maxResults = 10, $part = ['id', 'snippet', 'contentDetails', 'player', 'statistics', 'status'])
    {
        $API_URL = $this->getApi('videos.list');
        $params = [
            'chart' => 'mostPopular',
            'part' => implode(', ', $part),
            'regionCode' => $regionCode,
            'maxResults' => $maxResults,
        ];

        $apiData = $this->api_get($API_URL, $params);

        return $this->decodeList($apiData);
    }

Is there a way to pass category?

alaouy commented 6 years ago

So it is not used in that method, maybe you can send me a PR to add

oroalej commented 5 years ago

Also want to ask if they can add the pageToken. Since the result for this API should be 200. However we can only access 50 results max.

alaouy commented 5 years ago

@oroalej Yes that seems about right, PRs are always welcome if you want to contribute