PHP code example of nekland / youtube-api
1. Go to this page and download the library: Download nekland/youtube-api library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nekland / youtube-api example snippets
$youtube = new Youtube();
// You have to authenticate to access the youtube api
$youtube->authenticate(
'JsonFileServiceAuth',
['json_file' => 'my_google_certificate.json']
);
// The info variable will contains an array of data returned by google
$info = $youtube->api('videos')->getById('RnpyRe_7jZA');