PHP wrapper for the Youtube Data API v3 & YouTube Downloader
A basic PHP wrapper for the Youtube Data API v3 ( Non-OAuth ). Designed to let devs easily fetch public data (Video & Channel) from Youtube. No 3rd party dependancy. The reason of returning the ARRAY response directly is to keep it simple., (*1)
Some parameters are missing in this library, because I don't need them at this point, if you desire a particular feature please file an issue here :smile:, (*2)
Run the following command in your command line shell in your php project, (*3)
composer require madcodez/youtube
<?php require 'vendor/autoload.php'; $youtube = new Madcodez\YouTube\YouTube('* Your API key here *'); $chart = $youtube->chart('10', $pageToken); print_r($chart);
<?php require 'vendor/autoload.php'; $youtube = new Madcodez\YouTube\YouTube('* Your API key here *'); $catVid = $youtube->videoByCat('2', '10', $pageToken); print_r($catVid);
<?php require 'vendor/autoload.php'; $youtube = new Madcodez\YouTube\YouTube('* Your API key here *'); $seach = $youtube->search('Web Development', '10', $pageToken); print_r($search);
<?php require 'vendor/autoload.php'; $youtube = new Madcodez\YouTube\YouTube('* Your API key here *'); $video = $youtube->video('rie-hPVJ7Sw'); print_r($video);
<?php require 'vendor/autoload.php'; $youtube = new Madcodez\YouTube\YouTube('* Your API key here *'); $channel = $youtube->channel('UC0gTtCL29NCuex5OApWXpPQ', '10', $pageToken); print_r($channel);
<?php require 'vendor/autoload.php'; $youtube = new Madcodez\YouTube\YouTube('* Your API key here *'); $related = $youtube->related('nLzV5l0Enww', '10', $pageToken); print_r($related);
2 - Autos & Vehicles, (*4)
1 - Film & Animation, (*5)
10 - Music, (*6)
15 - Pets & Animals, (*7)
17 - Sports, (*8)
18 - Short Movies, (*9)
19 - Travel & Events, (*10)
20 - Gaming, (*11)
21 - Videoblogging, (*12)
22 - People & Blogs, (*13)
23 - Comedy, (*14)
24 - Entertainment, (*15)
25 - News & Politics, (*16)
26 - Howto & Style, (*17)
27 - Education, (*18)
28 - Science & Technology, (*19)
29 - Nonprofits & Activism, (*20)
30 - Movies, (*21)
31 - Anime/Animation, (*22)
32 - Action/Adventure, (*23)
33 - Classics, (*24)
34 - Comedy, (*25)
35 - Documentary, (*26)
36 - Drama, (*27)
37 - Family, (*28)
38 - Foreign, (*29)
39 - Horror, (*30)
40 - Sci-Fi/Fantasy, (*31)
41 - Thriller, (*32)
42 - Shorts, (*33)
43 - Shows, (*34)
44 - Trailers, (*35)
The returnd data is a PHP Array, (*36)
For bugs, complain and suggestions please file an Issue here or send email to madcode.git@gmail.com :smile:, (*37)
This library is licensed under the MIT License., (*38)