PHP Classes

PHP YouTube Video Scraper: Get details about videos scraping YouTube pages

Recommend this page to a friend!
  Info   View files Example   View files View files (6)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 216 All time: 8,301 This week: 524Up
Version License PHP version Categories
facktube 1.0.0MIT/X Consortium ...5PHP 5, Web services, Video, Parsers


This class can get details about videos scraping YouTube pages.

It can perform searches about videos in YouTube by sending HTTP requests to YouTube site pages Web servers using given search keywords.

The class retrieves the YouTube search result pages and returns details about the videos that were found like the video id, title, thumbnail, description, channelName, channelID, duration, uploaded, views, badges, etc..

Picture of Miraz Mac
  Performance   Level  
Name: Miraz Mac <contact>
Classes: 13 packages by
Country: Bangladesh Bangladesh
Age: 29
All time rank: 201329 in Bangladesh Bangladesh
Week rank: 298 Up6 in Bangladesh Bangladesh Up
Innovation award
Innovation award
Nominee: 5x



use MirazMac\FackTube\FackTube;

__DIR__ . '/../vendor/autoload.php';

$options = [];
$fack = new FackTube($options);

$pageToken = isset($_GET['page']) ? trim($_GET['page']) : null;
$q = isset($_GET['q']) ? trim($_GET['q']) : 'Honest Trailer';

try {
$results = $fack->videos($q, $pageToken);
} catch (\
Exception $e) {
<form method="get" action="?">
    <label for="q">Query</label>
    <input type="text" name="q" id="q" value="<?php echo htmlspecialchars($q); ?>">
    <button type="submit">Search</button>
foreach ($results['videos'] as $video) {
foreach (
$results['pages'] as $page) {
'<li><a href="?page=' . $page['pageToken'] . '&q=' . htmlspecialchars($q) . '">' . $page['label'] . '</a></li>';

  Files folder image Files  
File Role Description
Files folder imagesrc (2 files)
Files folder imageusage (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file FackTube.php Class Class source
  Plain text file Helpers.php Class Class source

  Files folder image Files  /  usage  
File Role Description
  Accessible without login Plain text file videos.php Example Example script

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:8,301
This week:524Up