Componette

Componette

nextras

nextras / youtube-api v3.1.0

Lightweight API for YouTube (Google API v3)

download-cloud-line composer require nextras/youtube-api

Nextras YoutubeApi

Downloads this Month Stable version

Installation

Use composer:

$ composer require nextras/youtube-api

Usage

$reader = new Nextras\YoutubeApi\Reader('<your google-api key>')
$video = $reader->getVideoByUrl('<youtube url>');

echo $video->title;
echo $video->duration; // in sec
echo $video->description;
echo $video->url;
echo $video->embed;
foreach ($video->thumbs as $thumb) {
    echo $video->url; 
}

License

MIT. See full license.

  • v3.1.0 3.1.0

    New major version 3.1.0 is out! ๐ŸŽ‰ ๐ŸŒ What's changed from 3.0?

    • minimal version is PHP 7.1
    • fixed compatibility with PHP 7.2
    • removed Composer/CaBundle, use custom client, if needed (BC break!)
    • see full commit changelog
  • v3.0.0 3.0.0

    New major version 3.0.0 is out! ๐Ÿ‡ What's changed from 2.0?

    • minimal version is PHP 5.6 (BC break!)
    • internal change: switched form Kdyby/Curl to GuzzleHttp (BC break!) Thanks @trejjam
    • internal change: switched from Kdyby/CurlCaBundle to Composer/CaBundle (BC break!)
    • see full commit changelog
Componette Componette felix@nette.org