composer require exinfinite/ytc
use Exinfinite\YTC\Agent;
use Exinfinite\YTC\PlaylistItems;
$apikey = "api-key";
$agent = new Agent($apikey, __DIR__ . '/cache');
$fetcher = new PlaylistItems($agent);
Reference:https://developers.google.com/youtube/v3/docs/playlistItems
$playlistID = 'playlistID';
$data = $fetcher
->setPart(['snippet'])
->setPlaylistId($playlistID)
->setMaxResults(10)
->query(false);//true:ignore cache
- PlaylistItems
- Playlists
- Videos